Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Connect EJB form - Completing the Service tab

Updated on August 10, 2022

Use the Service tab to identify the properties of the remote EJB service. Complete the Service tab first.

Note: Beginning in Pega Platform 8.6, EAR deployments of Pega Platform are deprecated. In the upcoming 8.7 release, EAR deployments will not be supported. As a result, in Pega Platform 8.7, Connect EJB rules will also no longer be supported. For more information on the alternatives for EAR-related rules, see Deprecation of EAR deployments in Pega Platform 8.6.

As you work with the form, the information on this tab is used to connect to the JNDI server and automatically complete fields on the Create and Remote tabs.

JNDI server

FieldDescription
Server name Select the JNDI server (instance of Data-Admin-Connect-JNDIServer) that identifies the EJB container with the bean you want to connect to. To connect to an EJB through its local interface, select the JNDI server named localEJBs. To connect to a remote EJB through an EJB reference rather than its JNDI name, select the JNDI server named remoteEJBrefs.

This field supports the Global Resource Settings syntax (=PageName.PropertyName). The default property name for this field is pyJNDIServerKey.

Lookup nameSelect a key to use to look up the EJB home object of the remote EJB in the JNDI server.

EJB home

FieldDescription
Java classEnter the name of the EJB Home Interface class to use to create an instance of the EJB client stub. If the JNDI Server and Lookup Name values are valid, this value is automatically filled in.
Create method Optional. Enter the type-signature of the EJB Home Interface method that creates an instance of the EJB client stub (for example: create(String, int)). This field is not required if you select the Require use of a valid object handle option of the EJB Remote/Initialize Object field.

EJB remote

FieldDescription
Initialize object Select how to initialize the EJB client stub:
  • Create a new object every time — perform a JNDI lookup and use the specified Create Method of the EJB Home Interface class to create an instance of the client stub each time this connector is called.
  • If possible, use a valid object handle — try to restore the client stub instance using the value contained in the Object handle property field. If the object handle value is blank or no longer valid, then perform a JNDI lookup and use the specified Create Method of the EJB Home Interface class to create an instance of the client stub.
  • Require use of a valid object handle — try to restore the client stub instance using the value of the property identified in the Object handle property field. If the object handle value is blank or no longer valid, report an error using the status properties. Use this option if the remote method being called must be preceded by an earlier remote method call.
Java classEnter the name of the EJB Remote Interface class that defines the remote methods that can be called on the EJB client stub instance. If the JNDI server and lookup names are valid, this value is filled in automatically.
Remote method Enter the type-signature of the EJB Remote Interface method that is called each time this connector is called. For example:
getListValue(int)
Finalize object Select how to finalize the EJB client stub:
  • Remove object after method call — call the client stub’s Remove method after the remote service method is called.
  • Keep alive and store object handle — store the client stub’s object handle value in the specified Object handle property after the remote service method is called. Use this option if you intend to call multiple remote methods on a single EJB instance, either for performance reasons, or to maintain the session state between method calls.
Object handle property Optional. Select a Single Value property for storing and/or recovering the serialized object handle of the EJB client stub instance. This field is not required if you select both the Create a new object every time option of the EJB Remote/Initialize Object field and the Remove object after method call option of the EJB Remote/Finalize Object field.

Error handling and test

FieldDescription
Error handling
Status value property Optional. Select a property for reporting the status of the remote service request. You can use the standard property @baseclass.pyStatusValue. The literal value Good identifies success.
Status message property Optional. Select a property for providing more information about errors that occur when processing the remote service request. You can use the standard property @baseclass.pyStatusValue.
Invocation exception property Optional. Select a property of mode Java Object to contain a Java exception, if this connection throws any exceptions at runtime.
Error handler flow Optional. Identify a flow rule that is to be started when this connector rule is started by a flow rule but fails. The default flow rule Work-.ConnectionProblem provides one approach for handling such problems. See Handling connector exceptions.
Test connectivity Click this button at any time after you have completed the information on this tab to confirm that Pega Platform can connect to the JNDI server identified and can validate the Home Interface and Remote Interface.
Note: The Test connectivity button does not work if either the localEJBs or remoteEJBrefs JNDI server is specified in the Server name field.

The system presents test results in a separate window, identifying the parameters used in the test, the steps attempted, and the outcome of each step.

Generate test client As a debugging aid, if your Pega Platform is hosted on a Java EE-platform (not Apache Tomcat) you can generate a stand-alone Java client program that calls the EJB.
  1. Save the rule.
  2. Copy a vendor-supplied EJB.jar library to the server and make sure that this library appears in the server's $CLASSPATH Environment variable.
  3. If you changed the $CLASSPATH, stop and restart the Pega Platform.
  4. Open the Connect EJB rule.
  5. Click Generate test client.

This produces a Java source file in the ServiceExport directory.

Simulations Click to create a simulator for this connect rule.
  • Previous topic Connect EJB rules - Completing the New or Save As form
  • Next topic Connect EJB form - Completing the Create tab

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us