1 Reply Latest reply on Jul 26, 2010 1:47 PM by lexsoto

    Configuring JBossAS 5.1 client talking to remote MQ

    lexsoto

      Hi,

       

      We have a dedicated JBossMQ server running on JBossAS 4.2.2.GA which we rather don't migrate at this point. 

      We need to connect to this server from EJBs and MDBs running on JBoss AS 5.1. 

       

      Our MDBs appear to be working correctly, but we see this stack trace when sending messages from EJBs:

       

       

      2010-07-26 10:26:49,969 ERROR [org.jboss.resource.adapter.jms.inflow.JmsServerSession] (WorkManager(2)-9) org.jboss.resource.adapter.jms.inflow.JmsServerSession$DemarcationStrategyFactory@424e94d5 error creating transaction demarcation 
      java.lang.NoClassDefFoundError: org/jboss/resource/connectionmanager/xa/JcaXAResourceWrapperFactory
      at org.jboss.resource.adapter.jms.inflow.JmsServerSession$XATransactionDemarcationStrategy.<init>(JmsServerSession.java:413)
      at org.jboss.resource.adapter.jms.inflow.JmsServerSession$DemarcationStrategyFactory.getStrategy(JmsServerSession.java:296)
      at org.jboss.resource.adapter.jms.inflow.JmsServerSession.createTransactionDemarcation(JmsServerSession.java:257)
      at org.jboss.resource.adapter.jms.inflow.JmsServerSession.run(JmsServerSession.java:226)
      at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:205)
      at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:260)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:637)
      
      
      

       

      I have looked everywhere but was unable to find what I am missing.

       

      On the JBoss AS 5.1 instance I have done the following:

       

      1. Deployed the jbossmq.jar from the 4.2.2.GA server in the lib director
      2. Removed all the JBoss Messaging files.
      3. Deployed the jms-ra.rar file from the 4.2.2.GA server.
      4. Deployed the following -ds.xml file:

       

      <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
            name="jboss.mq:service=JMSProviderLoader,name=HAJNDIJMSProvider">
          <attribute name="ProviderName">DefaultJMSProvider</attribute>
          <attribute name="ProviderAdapterClass">
            org.jboss.jms.jndi.JNDIProviderAdapter
          </attribute>
          <attribute name="FactoryRef">XAConnectionFactory</attribute>
          <attribute name="QueueFactoryRef">XAConnectionFactory</attribute>
          <attribute name="TopicFactoryRef">XAConnectionFactory</attribute>
          <attribute name="Properties">
             java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
             java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
             java.naming.provider.url=${jms.url}
             jnp.disableDiscovery=false
             jnp.partitionName=${jboss.partition.name:DefaultPartition}
             jnp.discoveryGroup=${jboss.partition.udpGroup:230.0.0.4}
             jnp.discoveryPort=1102
             jnp.discoveryTTL=16
             jnp.discoveryTimeout=5000
             jnp.maxRetries=1
          </attribute>
        </mbean>
      
        <tx-connection-factory>
          <jndi-name>JmsXA</jndi-name>
          <xa-transaction/>
          <rar-name>jms-ra.rar</rar-name>
          <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>
          <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
          <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property>
          <max-pool-size>20</max-pool-size>
          <security-domain-and-application>JmsXARealm</security-domain-and-application>
        </tx-connection-factory>
      
      

       

      I need my EJBs to be able to send messages in the context of a transaction, so I am using the JmsXA connection factory.

      Any help would be greatly appreciated.

       

      Thanks.

        • 1. Re: Configuring JBossAS 5.1 client talking to remote MQ
          lexsoto

          I think I found the problem. 

           

          The 5.1.GA version of  "jms-ra.rar"  resource adapter needs to be used instead of the version from the 4.2.2.GA JBossAS.

          For some reason, I thought this resource adapter was specific to the newer JBoss messaging server so I had replaced it with the older MQ one.

          It appears that the old ra is referencing class "JcaXAResourceWrapperFactory" which can't be resolved.

           

          Am I doing this correctly?

           

          I still need to do more testing but at least the exception is no longer showing.

           

          Thanks