Copyright © Cloud Software Group, Inc. All Rights Reserved |
This section explains how to create and configure an EJB reference in TIBCO Business Studio. For the general procedures and properties of a TIBCO ActiveMatrix reference, refer to the TIBCO ActiveMatrix documentation.
2. Select File > New > Project from the Menu. The New Project dialog appears.
3. Expand the TIBCO SOA Platform folder and select the TIBCO SOA Project item in the Select A Wizard page, then click the Next button, the New TIBCO SOA Project dialog appears.
− Check the Use Default Location checkbox to use the default location to store the project.
− Uncheck the Use Default Location checkbox, and click the Browse button to specify a location to store the project.Click the Next button, the Asset Type Selection page appears.
5. Click the Select All button to select all the asset types to configure for the project, then click the Next button. The Composite Project dialog appears.
6. Select the Basic SOA Project item in the Project Types area as the project type, then click the Next button. The Composite Details dialog appears to show the composite details.
− Keep the default settings for each field, and click the Next button to the Set Special Folders dialog.
− Specify the settings as you want for each field, and click the Next button to the Set Special Folders dialog.
− Keep the default settings for each field, and click the Finish button.
−
8. After clicking the Finish button, the Open Associated Perspective dialog appears.
− Click the Yes button to open the project perspective.
− Click the No button to open the project perspective later.TIBCO Business Studio creates a basic SOA project with a composite containing an abstract component wired to a promoted service and reference.Task B Create an EJB Reference
a.
b.
c. As the diagram in Figure 4 shows, the SOA project contains a service that stands on the left side, a component that stands in the middle, and a reference that stands on the right side. You can specify names for each interface.Figure 4 Opening the Project Composite Editor
b.
c. Select the EJB Binding item in the List of Bindings as shown in Figure 5, and click the Finish button.Figure 5 Adding an EJB BindingTask C Specify the EJB Client JARs
When specifying EJB client JARs, keep the following in mind:
• The EJB client JAR must be able to invoke enterprise beans deployed on your designated application server.@Stateless, @Remote, @XmlType, @XmlRootElement, @XmlSchema, @WebFault, and @WebService series.
• Deployment descriptor differences affect EJB JARs porting across different application servers.
• For IBM WebSphere 6.1 and 7, you must specify the EJB client JAR that has WebSphere specific stub classes incorporated, which is created during the process of deploying the EJB JAR into WebSphere.
− In the Bindings tab, click the Generate button beside the Client Jars Plug-in field. The Generate WSDL from EJB Client JAR dialog appears as shown in Figure 6.
− Right-click the reference in the Composite Editor panel, and select the Generate WSDL from EJB Client JAR... item. The Generate WSDL from EJB Client JAR dialog appears as shown in Figure 6.Figure 6 Generating WSDL from EJB Client JAR
2. The EJB client JAR must be contained in a Java plug-in project. You can select the following two options to generate the EJB client JAR:
− Select the Generate WSDL from EJB Client JAR radio button, then click the File System... or Workspace... button and browse to the EJB client JAR location, then select the EJB client JAR or any JARs it depends on, and click the Open button.Figure 6 shows the purchaseorder.jar EJB client JAR selected from the sample distributed with TIBCO ActiveMatrix Binding Type for EJB.
− Select the Generate WSDL from Existing EJB Client JAR Project radio button, then click the Browse button to select an existing EJB Client JAR as shown in Figure 7, then click the OK button.
You can only reuse a Java plug-in project used by another reference within the composite. You cannot use a Java plug-in project referenced by another composite.Figure 7 Selecting an Existing EJB Client JAR
3. After selecting the EJB Client JARs, click the Next button, and the Target EJB Interface dialog appears.
4. In the Target EJB Interface dialog, the target EJB interface checkbox is checked by default. If not, then check the checkbox.In the right area, all information of EJB component properties are loaded and displayed. This information cannot be changed except the EJB JNDI Name. See Figure 8. Then click the Next button, and the WSDL Generation dialog appears.Figure 8 Selecting the EJB Target Interface
5. Enter or select the parent folder where you want to save the WSDL file, then click the Finish button to save the project.By default, TIBCO Business Studio generates a WSDL file in the Service Descriptors folder and a Java plug-in project named ejbpackagename, which is the name of the EJB package. The EJB client JAR is added to the plug-in project.For example, Figure 9 shows the WSDL file named PurchaseOrderServiceBean.wsdl and com.tibco.amxext.ejbbinding.sample.purchaseorder.purchaseorderservice plug-in project created when an EJB client JAR purchaseorder.jar is selected. The purchaseorder.jar EJB client JAR contains the EJB interface that defines a purchase order service.
• Figure 9 The WDSL File and Plug-in ProjectTask D Specify the EJB JNDI Name
2. Click the EJB reference, then click the Bindings tab in the Properties area.
3. Expand EJBReference_Binding1 > EJB Interface.For example, if your EJB Bean’s name is EJB3TestBean, the JNDI name for invoking EJB 3.0 is:WebSphere: EJB3TestBeanBefore accessing an enterprise bean, an EJB client must obtain a reference to the EJB home object. The EJB client has the JNDI name of the object. Therefore, before invoking operations, the EJB client must look up the JNDI name of the EJB home object in the application server’s JNDI namespace. To enable this lookup, you configure the JNDI context factory and URL for the server that manages namespace in the EJB reference’s connectivity.
2. Click the EJB reference, then click the Bindings tab in the Properties panel, and select the EJB binding that you just created.
3. In the Connectivity area, click the Add button beside the JNDI Driver drop-down list. The Add a JNDI Driver dialog appears. See Figure 10.
If you cannot see the JNDI Driver list in the General tab, you need to drag the dialog border to enlarge its size.
4. In the General tab, select the JNDI driver that you want to add. For example, select the WebLogic application server, then set the values in the JNDI Context URL, User Name, and Password fields. See Adding or Editing JNDI Drivers for more information.Click the Add JAR... button, browse to the driver JAR location, then open the JAR file you want to add.Select a driver JAR, and click the Edit JAR... button. You can browse to another JAR location and click OK to replace the selected one.Select a driver JAR, and click the Remove JAR... button. The selected JAR is removed from the list.Click the Clear ALL button to remove all the JARs from the list.Figure 11 shows the WebLogic application server JARs list.
6. After finishing your selection, click the OK button. The JNDI driver that you configured is added to the JNDI Driver drop-down list as shown in Figure 12, and the corresponding properties are shown in the Vendor and Context URL fields.Figure 12 JNDI Driver Drop-down ListIf needed, you can edit the JNDI driver properties by clicking the Edit button beside the JNDI Driver drop-down list.To ensure that an EJB client can look up the EJB home object, you can test the EJB connectivity properties by clicking the Test Connection button in the Connectivity area. This operation checks that the EJB JNDI Name can be resolved in the JNDI server.
• For JBoss, if you use an IP Address instead of local host, you must specify the JBoss startup parameter -Djboss.bind.address=0.0.0.0.
• The username and password have been added for security enhancement. When you set the username and password, make sure they are same as those setup in the JNDI driver design-time or setup in the application server.
• If you fail to connect to the application server using the username and password for WebLogic 10 security, open the TIBCOBusinessStudio.ini file, then add a line -Dsun.lang.ClassLoader.allowArraySyntax=true. Save the file, then restart TIBCO Business Studio and retest the connectivity.
Copyright © Cloud Software Group, Inc. All Rights Reserved |