The Enterprise JavaBean Execution step lets you acquire a reference to and make calls on an Enterprise JavaBean (EJB) running in a J2EE application server.
Testing an EJB is similar to testing a Java object. DevTest dynamically connects to the EJB using the Home EJB interface, and then from it creates an instance of an EJB object. This process is a little different for EJBs, as they do not require a home interface. The EJB under test is loaded into the Complex Object Editor, where it can be manipulated without having to write any Java code.
Prerequisites: Knowledge of the Complex Object Editor is assumed. The application client JAR and client EJB JAR must be in the DevTest classpath. Both of these JAR files are copied into the hotDeploy directory. The hotDeploy directory contains the jboss-all-client.jar file for the JBoss application server and the examples JAR file so you can run the EJB examples immediately.
Parameter Requirements:
The EJB deployer should provide this information.
IBM has an EJB and JMS client that you can download and use with the Sun JVM. The client is available here.
Follow these steps:
java -jar sibc_install-o0902.06.jar jms_jndi_sun <output_directory>
For example: LISA_PRE_CLASSPATH=C:\sibc.jms.jar;C:\sibc.jndi.jar;C:\sibc.orb.jar;
com.ibm.CORBA.ORBInit=com.ibm.ws.sib.client.ORB
This example uses the ITKO example server, a JBoss server. To use your local demo server, use localhost as the host name.
Select your application server from the list. If your application server is not on the list, select the Other/You Specify option.
The lower section of the editor changes, depending on your selection. The previous graphic shows the configuration panel for JBoss.
Enter the hostname or IP address of your application server.
Enter the port number.
Enter if a user ID is required for the application server.
Enter if a password is required for the application server.
For the Other/You Specify Window
Enter or select the fully qualified JNDI factory class name for your application server.
Enter or select the JNDI server name.
Enter if a user ID is required for the application server.
Enter if a password is required for the application server.
The New EJB Setup window opens and lists all the JNDI names that are registered with the application server.
In this example, the JNDI name is com.itko.examples.ejb.UserControlBean. The EJB3 specification enables stateful and stateless beans to bind to the JNDI tree directly and not require a home interface. If so, the bean can be selected directly and DevTest does not need to create an instance.
The object is constructed and loaded into the Complex Object Editor.
In the Execution Info area, the current EJB information is displayed. If you plan to reuse this EJB, you can keep the references to the EJB object and the EJB Home by selecting the following check boxes:
If the bean is an EJB 3 bean without a home interface, the Keep EJB Home Reference check box is disabled. Set the If Exception to the step to redirect to if an exception occurs.
The EJB step has a default name using this convention: EJB javaMethod dynamic java execution. Before the step is saved, is entered, as shown previously, the default step name is EJB. If another step also uses the default step name, a number is appended to it. You can change step names at any time.
The usage is the same as in the RMI Server Execution step.
Copyright © 2014 CA Technologies.
All rights reserved.
|
|