Installing resource adapters embedded within applications

Install resource adapters in your applications so they can access outside data sources.

Before you begin

The JCA Version 1.6 specification adds support for Java annotations in RAR modules.

About this task

Procedure

  1. Assemble an application with RAR modules in it. See the topic Assembling applications for more information.
  2. Install the application. Follow the steps in the topic Installing a new application.

    In the Map modules to servers step, specify target servers or clusters for each RAR file. Be sure to map all other modules that use the resource adapters defined in the RAR modules to the same targets. Also, specify the web servers as targets that serve as routers for requests to this application. The plug-in configuration file (plugin-cfg.xml) for each web server is generated based on the applications that are routed through it.

    In the Metadata for modules step of installing an application, you can set or unset the metadata-complete flag as discussed in the topic, JCA 1.6 support for annotations in RAR modules.

    Note: When installing a RAR file on a server, the application server looks for the manifest (MANIFEST.MF) for the connector module. The application server first looks for the RAR file's connectorModule.jar file and loads the manifest from the connectorModule.jar file. If the class path entry is in the manifest from the connectorModule.jar file, the RAR uses that class path.

    To ensure that the installed connector module finds the classes and resources that it needs, check the Class path setting for the RAR using the administrative console. For more information on how to check this setting, see the topics Resource adapter settings and WebSphere relational resource adapter settings.

  3. Click Finish > Save to save the changes.
  4. Create connection factories for the newly installed application.

Results

Note: A given native library can only be loaded one time for each instance of the Java™ virtual machine (JVM). Because each application has its own class loader, separate applications with embedded RAR files cannot both use the same native library. The second application receives an exception when it tries to load the library.

If any application deployed on the application server uses an embedded RAR file that includes native path elements, then you must always ensure that you shut down the application server cleanly, with no outstanding transactions. If the application server does not shut down cleanly it performs recovery upon server restart and loads any required RAR files and native libraries. On completion of recovery, do not attempt any application-related work. Shut down the server and restart it. No further recovery is attempted by the application server on this restart, and normal application processing can proceed.