1 Reply Latest reply on May 22, 2014 2:02 PM by samhain

    Generic JMS Resource adapter startup order

    samhain Newbie

      I have deployed and configured the Generic JMS resource adapter in my EAP 6.1 server under the standalone-full.xml resource-adapters subsystem.

       

      <subsystem xmlns="urn:jboss:domain:resource-adapters:1.1">

                  <resource-adapters>

                      <resource-adapter id="generic-jms-ra.rar">

                          <archive>

                              generic-jms-ra.rar

                          </archive>

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

                          <connection-definitions>

                              <connection-definition class-name="org.jboss.resource.adapter.jms.JmsManagedConnectionFactory" jndi-name="java:/GenericJmsXA" enabled="true" use-java-context="true" pool-name="GenericJmsXA" use-ccm="true">

                                  <config-property name="JndiParameters">

                                      java.naming.factory.initial=com.tibco.tibjms.naming.TibjmsInitialContextFactory;java.naming.provider.url=tcp://X.X.X.X:7222,tcp://X.X.X.X:7222

                                  </config-property>

                                  <config-property name="ConnectionFactory">

                                      QueueConnectionFactory

                                  </config-property>

                                  <pool>

                                      <min-pool-size>0</min-pool-size>

                                      <max-pool-size>50</max-pool-size>

                                      <prefill>false</prefill>

                                      <use-strict-min>false</use-strict-min>

                                      <flush-strategy>FailingConnectionOnly</flush-strategy>

                                  </pool>

                                  <security>

                                      <application/>

                                  </security>

                              </connection-definition>

                          </connection-definitions>

                      </resource-adapter>

           </resource-adapters>

      </subsystem>

       

      I'm able to leverage this connection factory without issue in a WAR by using resource injection like:

       

      @Resource(mappedName="java:/GenericJmsXA", type=JmsConnectionFactory.class)

      JmsConnectionFactory connectionFactory2;

       

      Sometimes, when I start up EAP 6.1 however, I get the following error:

       

      10:42:00,525 INFO  [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report

      JBAS014775:    New missing/unsatisfied dependencies:

            service jboss.naming.context.java.GenericJmsXA (missing) dependents: [service jboss.naming.context.java.module.JBossSecure.JBossSecure.env."com.mak.testing.SecureService".connectionFactory2, service jboss.naming.context.java.module.JBossSecure.JBossSecure.env.GenericJmsXA]

       

      This is completely random, so it has to be some sort of dependancy/startup order issue where the resource adapter hasn't been fully started prior to the WAR starting.  If, when the server starts up in this state, I undeploy the WAR, I get the following message:

       

      10:58:48,236 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report

      JBAS014776:    Newly corrected services:

            service jboss.naming.context.java.GenericJmsXA (no longer required)

       

      Has anyone figure out how to "remind" JBoss of this dependancy?

       

      Things I've tried:

      1)   Added " Dependencies: deployment.generic-jms-ra.rar" to my WAR's MANIFEST.MF

      2)   Added <module name="deployment.generic-jms.ra.rar"/> to my WAR's jboss-deployment-structure.xml

      3)   Added <resource-ref> elements to my WAR's web.xml

        • 1. Re: Generic JMS Resource adapter startup order
          samhain Newbie

          To ensure proper startup order, I modified the resource adapter config to load the rar as a module.

           

          The module contained the generic-jms-ra.jar and the META-INF/ra.xml file, as well as the jboss module.xml

           

          After that, any WAR/MDB that wants to utilize the resource adapter can add the dependancy via a jboss-deployment-structure.xml

           

          jboss-deployment-structure.xml

          <jboss-deployment-structure>

              <deployment>

                  <dependencies>

           

                      <module name="org.jboss.resource.adapter.jms"/>

                  </dependencies>

              </deployment>

          </jboss-deployment-structure>

           

          module.xml

              <module xmlns="urn:jboss:module:1.1" name="org.jboss.resource.adapter.jms" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

             <resources>

                <resource-root path="."/>

                <resource-root path="generic-jms-ra.jar"/>

                <resource-root path="tibjms-6.1.0.jar"/> <!--  for tibco integration -->

             </resources>

           

           

             <dependencies>

                <module name="javax.api"/> 

                <module name="javax.resource.api"/>

                <module name="javax.jms.api"/> 

                <module name="javax.management.j2ee.api"/>

                <module name="org.jboss.logging"/>

             </dependencies>

          </module>

           

          standalone-xxx.xml

          <subsystem xmlns="urn:jboss:domain:resource-adapters:1.1">

                      <resource-adapters>

                          <resource-adapter id="org.jboss.resource.adapter.jms.ra">

                              <module slot="main" id="org.jboss.resource.adapter.jms"/>

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

                              <connection-definitions>

                                                     .....

                                  </connection-definition>

                              </connection-definitions>

                          </resource-adapter>

               </resource-adapters>

          </subsystem>