+

Search Tips   |   Advanced Search

Configure resource adapters

We can configure resource adapters that comply with the Java EE Connector Architecture (JCA) specification versions 1.6, 1.5, or 1.0.

We can install and configure a resource adapter and the various connection factories, administered objects, and activation specifications as defined in the JCA specification.

  1. Update server.xml to add the jca-1.6 feature under the featureManager tag. The server.xml file is found at [path_to_liberty\wlp\usr\servers\server_name]
     <featureManager>
      <feature>jca-1.6</feature>
     </featureManager>

  2. Optional. Enable the following additional features based on the needs of the system:

    • If the resource adapter provides JMS specification interfaces, enable the jms-1.1 feature.

        <feature>jms-1.1</feature>

    • To look up connection factories and administered objects from the application, enable the jndi-1.0 feature.

        <feature>jndi-1.0</feature>

    • If the resource adapter provides activation specifications for message driven beans, enable the mdb-3.1 feature.

        <feature>mdb-3.1</feature>

    • If the resource adapter supports inbound security, enable the jcaInboundSecurity-1.0 feature.

        <feature>jcaInboundSecurity-1.0</feature>

    • If the resource adapter supports bean validation and we want our beans to be validated, we can enable the beanValidation-1.0 feature.

        <feature>beanValidation-1.0</feature>

  3. Configure one or more resource adapters in the server. We can use one of the following methods to configure the resource adapter.

    • Configure a standalone resource adapter by editing theserver.xml file.

        <resourceAdapter location="C:/adapters/MyAdapter.rar"/>

    • Configure an embedded resource adapter by editing server.xml to install an application that embeds one or more resource adapter modules. The following example assumes that the app1.ear file contains one or more embedded RAR files:

    • Allow the server to automatically configure a standalone resource adapter by dropping the RAR file in the server drop-ins folder.

        wlp/usr/servers/your-server-name/dropins/MyDropinAdapter.rar

    • Allow the server to automatically configure an application containing one or more embedded resource adapters by dropping the EAR file in the server drop-ins folder. The following example assumes that the app2.ear file contains one or more embedded RAR files:

        wlp/usr/servers/your-server-name/dropins/app2.ear

  4. Start the application server. After the server is started, messages such as the following are displayed in the console.log file:
    [AUDIT ] J2CA7001I: Resource adapter MyAdapter installed in 0.495 seconds. 
    [AUDIT ] J2CA7001I: Resource adapter MyDropinAdapter installed in 0.311 seconds. 
    [AUDIT ] J2CA7001I: Resource adapter app1.MyEmbeddedAdapter installed in 0.247 seconds.
    [AUDIT ] J2CA7001I: Resource adapter app2.anotherEmbeddedAdapter installed in 0.518 seconds.


Example

A unique identifier for a resource adapter is necessary to identify configured instances of connection factories, administered objects, and activation specifications as being associated with an installed resource adapter. For stand-alone resource adapters, the module name is used as the identifier. For resource adapters embedded in applications, the combination of the application name plus the module name (delimited by the period character) are used as the identifier.


Parent topic:

Overview of JCA configuration elements