2 Replies Latest reply on May 20, 2013 12:38 PM by James Olsen

    JBoss EAP 6.1.0.Beta1 ResourceAdapter Deployed but Not Started or Associated with MCF

    James Olsen Newbie

      I have a custom ResourceAdapter which includes a ManagedConnectionFactoryImpl.  The ResourceAdapter is annotated with @javax.resource.spi.Connector and the ManagedConnectionFactoryImpl is annotated with @javax.resource.spi.ConnectionDefinition and implements ResourceAdapterAssociation.  I have an ironjacamar.xml in the RAR as follows:

       

      <connection-definitions>

      <connection-definition jndi-name="java:/eis/TCP" class-name="xxx.TCPConnectionFactoryImpl" />

      </connection-definitions>

       

      The problem that I am having is that although the RAR is being deployed and the ConnectionFactory is being bound to JNDI as shown below, the ResourceAdapterAssociation#setResourceAdapter(...) callback on the MCF is never invoked nor is the ResourceAdapter#start(...) method.

       

      12:40:02,153 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-10) JBAS010406: Registered connection factory java:/eis/TCP

      12:40:02,156 INFO  [org.jboss.as.connector.deployers.RADeployer] (MSC service thread 1-10) IJ020002: Deployed: file:/XXX/jboss-eap-6.1/standalone/tmp/vfs/deploymentf64462aa42d86cdf/XXX-tcp-rar.rar-99e55f11ad53e7dd/contents/

      12:40:02,158 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-9) JBAS010401: Bound JCA ConnectionFactory [java:/eis/TCP]

       

      I have @javax.annotation.Resource(lookup = "java:/eis/TCP") references that are injected succesfully but when I obtain a Connection from the Factory the Connection is not useable as it lacks the ResourceAdapter association.

      I'm not using MDBs so do not have any @ResourceAdapter annotations anywhere.

       

      This used to work OK with 7.1.3.Final.  It appears that something has changed since then.  Any ideas on what I might be missing would be appreciated.

       

      Environment:

      JCA Subsystem (JBoss IronJacamar 1.0.16.Final-redhat-1)

      JBoss EAP 6.1.0.Beta1 (AS 7.2.0.Final-redhat-4)

        • 1. Re: JBoss EAP 6.1.0.Beta1 ResourceAdapter Deployed but Not Started or Associated with MCF
          James Olsen Newbie

          I've made some further discoveries:

          1. The problem is intermittent.  It does work some of the time.

          2. When it doesn't work, the <resourceadapter-class> is not present in the CMD passed to ParsedRaDeploymentProcessor.  Here's an example where we can see there is no <resourceadapter-class> between <resourceadapter> and <outbound-resourceadapter>:

           

          13:08:12,831 DEBUG [org.jboss.as.connector.deployment] (MSC service thread 1-8) ParsedRaDeploymentProcessor: CMD=<?xml version="1.0" encoding="UTF-8"?>

          <connector version="1.6" metadata-complete="false">

          <module-name></module-name>

          <vendor-name></vendor-name>

          <eis-type></eis-type>

          <license><license-required>false</license-required></license>

          <resourceadapter-version>1.6</resourceadapter-version>

          <resourceadapter>

          <outbound-resourceadapter>

          <connection-definition>

          <managedconnectionfactory-class>xxx.TCPManagedConnectionFactoryImpl</managedconnectionfactory-class>

          <connectionfactory-interface>xxx.TCPConnectionFactory</connectionfactory-interface>

          <connectionfactory-impl-class>xxx.TCPConnectionFactoryImpl</connectionfactory-impl-class>

          <connection-interface>xxxi.TCPConnection</connection-interface>

          <connection-impl-class>xxx.TCPConnectionImpl</connection-impl-class>

          </connection-definition>

          <transaction-support>NoTransaction</transaction-support>

          <reauthentication-support>false</reauthentication-support>

          </outbound-resourceadapter>

          <inbound-resourceadapter><messageadapter></messageadapter></inbound-resourceadapter>

          </resourceadapter>

          </connector>

           

          Using a simple RA created via the codegenerator I do get this entry, e.g:

          ...

          <resourceadapter>

          <resourceadapter-class>test.one.Test1ResourceAdapter</resourceadapter-class>

          <outbound-resourceadapter>

          ...

           

          I've looked for differences between the generated code and my code and they include:

          - additional third party jars in the rar.

          - some inheritance in the connection objects to keep boiler plate stuff in abstract classes.

           

          I suspect there's some kind of change in the way that 7.2.0 discovers the <resourceadapter-class> versus how it worked in 7.1.3.

          • 2. Re: JBoss EAP 6.1.0.Beta1 ResourceAdapter Deployed but Not Started or Associated with MCF
            James Olsen Newbie

            Adding an ra.xml that specifies the <resourceadapter-class> resolves the problem.

             

            I'm guessing that the presence of an abstract ResourceAdapter superclass (again used to avoid boilerplate code) is confusing Weld or whatever is doing the discovery.  This super class is 'abstract' and does not have a @Connector annotation so should not be considered as a ResourceAdapter candidate.