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:

Steps for this task: To add an embedded resource adaptor to a WAS, complete the following steps:

  1. Switch to the Java EE perspective.

  2. 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:

      1. In the Enterprise Explorer view, expand your enterprise application project folder.

      2. 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.

      3. 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:

      1. In the Enterprise Explorer view, right-click your enterprise application project folder.

      2. Select

        Java EE | Open WAS Deployment.

  3. 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.

  4. Add the connector project to your enterprise application.

    1. Select the

      Module tab at the bottom of the editor.

    2. In the

      Module section, click the

      Add button. The Add Module wizard opens.

    3. Under the

      Projects Found list, select the connector project you want to add to the server and click the Finish button.

  5. Select the

    Deployment tab at the bottom of the Application Deployment Descriptor editor.

  6. Expand the

    Embedded J2C Options section.

  7. Under the

    Embedded J2C Resource Adapters list, select a resource adapter that you want to configure as an embeded RAR file.

  8. (Optional) Click the

    View button to open the

    Embedded Resource Adapter Info dialog box for details about the embedded resource adapter.

  9. Configure the embedded J2C connection factories:

    1. Click the Add button beside the embedded J2C connection factories table. The Create Connection Factory wizard opens.

    2. 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.

    3. Click OK.

  10. Configure the embedded J2C administered objects:

    1. 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).

    2. 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.

    3. Click OK.

  11. Configure the embedded J2C activation specification:

    1. 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).

    2. 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.

    3. Click OK.

  12. 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:

  1. 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.

  2. Close the Application Deployment Descriptor editor.

  3. Open the Application Deployment Descriptor editor to see the updates.

Related Concepts

J2EE Connector Architecture resource adapters