Adding embedded resource adapters to an enterprise application target for a WAS
Resource adapters are sets of related classes that let an application access a resource such as data, or an application on a remote server, often called an Enterprise Information System (EIS).
The resource adaptor archive (RAR) file is a Java™ archive (JAR) file that is used to package a J2C resource adapter for packaging and deploying on a server. An embedded RAR is packaged within an enterprise application (EAR); and deployed as a part of J2EE or Java EE application installation and is removed when the application is uninstalled from the server. Deploy your J2C artifacts as an embedded RAR file when the J2C artifacts is used by a single applications. In this scenario, the J2C artifacts for that embedded RAR are accessed only by the application in which it is embedded.
You can add resource adapters in the WebSphere® Application Server Deployment editor. Use the embedded J2C options section to configure embedded RAR files.
Prerequisite steps:
- Create an enterprise application and target the server to WAS v6.0, or later.
- Create or import a connector project set at J2C (formerly known as JCA) v1.5 or v1.0 in your workspace.
Steps for this task: To add an embedded resource adaptor to a WAS, complete the following steps:
- Switch to the Java EE perspective.
- The location of the WAS Deployment editor depends on the specification-level of your enterprise application project:
- If your enterprise application (EAR) project is at 1.2, 1.3 or 1.4 specification-level, complete the following steps:
- In the Enterprise Explorer view, expand your enterprise application project folder.
- Under the enterprise application project folder for which you want add or edit server configurations, double-click the
Deployment Descriptor to open the Application Deployment Descriptor editor.
- Select the
Deployment tab at the bottom of the editor.
Restriction: Before adding or removing J2EE modules, using the
Module page in the Application Deployment Descriptor editor, first click the
Deployment tab to activate the functions in the deployment page. Then add or remove your modules from the Module page. You need to complete this task for each Application Deployment Descriptor editor session that you want to add or remove modules from the Module page.
- If your enterprise application (EAR) project is at 5.0 specification-level, complete the following steps:
- In the Enterprise Explorer view, right-click your enterprise application project folder.
- Select
Java EE | Open WAS Deployment.
- Before adding or removing J2EE modules, using the
Module page in the Application Deployment Descriptor editor, first click the
Deployment tab to activate the functions in the deployment page. Then add or remove your modules from the Module page. You need to complete this task for each Application Deployment Descriptor editor session that you want to add or remove modules from the Module page.
- Add the connector project to your enterprise application.
- Select the
Module tab at the bottom of the editor.
- In the
Module section, click the
Add button. The Add Module wizard opens.
- Under the
Projects Found list, select the connector project you want to add to the server and click the Finish button.
- Select the
Deployment tab at the bottom of the Application Deployment Descriptor editor.
- Expand the
Embedded J2C Options section.
- Under the
Embedded J2C Resource Adapters list, select a resource adapter that you want to configure as an embeded RAR file.
- (Optional) Click the
View button to open the
Embedded Resource Adapter Info dialog box for details about the embedded resource adapter.
- Configure the embedded J2C connection factories:
- Click the Add button beside the embedded J2C connection factories table. The Create Connection Factory wizard opens.
- Update the
Create Connection Factory dialog box:
- Configuration Factory Interface (Required)
- Select the fully qualified name of the Connection Factory Interfaces supported by the resource adapter.
- Object Name (Required)
- Specify the name of the J2C connection factory.
- JNDI Name (Required)
- Specify the JNDI name of this connection factory.
- Click OK.
- Configure the embedded J2C administered objects:
- Click the Add button beside the embedded J2C administered objects table. The Create Administered Object wizard opens.
Tip: The
Add button is enabled, if you define J2C administered objects (<adminobject>) in your deployment descriptor of the resource adapter (ra.xml).
- Update the
Create Administered Object dialog box:
- J2C administered objects (Required)
- Select the fully qualified name of the Connection Factory Interfaces supported by the resource adapter.
- Object Name (Required)
- Type the name by which the J2C administered object is known for administrative purposes.
- JNDI Name (Required)
- Type an unique Java Naming and Directory Interface (JNDI) name that this administered object is bound under.
- Click OK.
- Configure the embedded J2C activation specification:
- Click the Add button beside the embedded J2C activation specifications table. The Create Activation Specification wizard opens.
Tip: The
Add button is enabled, if you define J2C activation specification (<inbound-resourceadapter>) in your deployment descriptor of the resource adapter (ra.xml).
- Update the
Create Activation Specification dialog box:
- J2C activation specifications (Required)
- Select the message listener type that this activation specification instance should support. This list is based on the deployment descriptor of the resource adapter (ra.xml).
- Object Name (Required)
- Specify the display name of the J2C activation specification instance.
- JNDI Name (Required)
- Type an unique Java Naming and Directory Interface (JNDI) name for the J2C activation specification instance.
- Destination jndi name
- Specify a destination JNDI name. This list is pre-filled with the JNDI names of the J2C administered objects that you have previously specified.
- Click OK.
- Close the editor and click
Yes to save the changes.
Result: The metadata for the embedded J2C resource adaptor is populated in the ibm-jcajndi.props file located in the x:/enterprise_project_name\EarContent\META-INF\ibm-jcajndi.props where x is the workspace of where your product is installed.
If you are running scripts to change the application deployment descriptor files from within the file system, to update the changes on the workbench complete the following:
- If the File Changed dialog box appears on the workbench, click the Yes button to load the changes from the file system to the workbench.
- Close the Application Deployment Descriptor editor.
- Open the Application Deployment Descriptor editor to see the updates.
Related Concepts
J2EE Connector Architecture resource adapters