1 Reply Latest reply on Feb 26, 2009 11:41 PM by Faisal Faizan

    Jboss 4.2 not supporting XA transaction

    Faisal Faizan Newbie

      Hi,

      I was able to install Jboss Transaction 4.2.2 (full version, JTA & JTS) in my Jboss 4.2 server by following the instructions on the site
      http://www.jboss.org/file-access/default/members/jbosstm/downloads/4.2.2/notes/jts_install.txt

      I am trying to deploy a basic application which talks to queues on TIBCO EMS server. I am using mule ESB for the same. When I use non-XA transaction I am able to deploy my application properly with receivers on queue. But when I use an XA transaction I am getting "Cannot start XA transaction" error.

      Note: I was not able to run it with the defalt JBossTS (JTA version) which comes with Jboss 4.2

      The detailed error is

      2009-02-26 06:05:06,350 DEBUG [org.mule.transaction.TransactionTemplate] Beginning transaction
      2009-02-26 06:05:06,350 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@15914f3, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@1f17c9e{ url=null ,addedOrder=0}
      2009-02-26 06:05:06,350 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@15914f3, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@145ad3d{ url=null ,addedOrder=0}
      2009-02-26 06:05:06,350 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@15914f3, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@1708593{ url=null ,addedOrder=0}
      2009-02-26 06:05:06,350 DEBUG [org.mule.transaction.XaTransaction] Beginning transaction
      2009-02-26 06:05:06,350 DEBUG [org.mule.transaction.TransactionCoordination] Binding new transaction (1)
      2009-02-26 06:05:06,350 DEBUG [org.mule.transaction.TransactionTemplate] Transaction successfully started
      2009-02-26 06:05:06,350 DEBUG [org.mule.providers.jms.xa.ConnectionFactoryWrapper] Invoking public native int java.lang.Object.hashCode()
      2009-02-26 06:05:06,350 DEBUG [org.mule.providers.jms.xa.ConnectionFactoryWrapper] Invoking public native int java.lang.Object.hashCode()
      2009-02-26 06:05:06,350 DEBUG [org.mule.providers.jms.xa.ConnectionFactoryWrapper] Invoking public abstract javax.jms.Message javax.jms.MessageConsumer.receive(long) throws javax.jms.JMSException
      2009-02-26 06:05:06,350 DEBUG [org.mule.providers.jms.xa.ConnectionFactoryWrapper] Enlistment request: org.mule.providers.jms.xa.ConnectionFactoryWrapper$ConnectionInvocationHandler$SessionInvocationHandler@1944379
      2009-02-26 06:05:06,350 DEBUG [org.mule.providers.jms.xa.ConnectionFactoryWrapper] Enlisting resource in xa transaction: com.tibco.tibjms.TibjmsXAResource@d9cc1a
      2009-02-26 06:05:06,366 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@15914f3, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@99c4cc{ url=null ,addedOrder=0}
      2009-02-26 06:05:06,366 DEBUG [org.mule.providers.jms.xa.ConnectionFactoryWrapper] Invoking public java.lang.String java.lang.Object.toString()
      2009-02-26 06:05:06,366 DEBUG [org.mule.providers.jms.xa.ConnectionFactoryWrapper] Invoking public native int java.lang.Object.hashCode()
      2009-02-26 06:05:06,366 DEBUG [org.mule.providers.jms.xa.ConnectionFactoryWrapper] Invoking public native int java.lang.Object.hashCode()
      2009-02-26 06:05:06,366 DEBUG [org.mule.providers.jms.xa.ConnectionFactoryWrapper] Invoking public abstract void javax.transaction.xa.XAResource.start(javax.transaction.xa.Xid,int) throws javax.transaction.xa.XAException
      2009-02-26 06:05:06,366 DEBUG [org.mule.providers.jms.xa.ConnectionFactoryWrapper] Invoking public native int java.lang.Object.hashCode()
      2009-02-26 06:05:15,850 INFO [com.arjuna.ats.arjuna.logging.arjLogger] Periodic recovery - second pass <Thu, 26 Feb 2009 06:05:15>
      2009-02-26 06:05:15,850 INFO [com.arjuna.ats.arjuna.logging.arjLogger] AtomicActionRecoveryModule: Second pass
      2009-02-26 06:05:15,850 INFO [com.arjuna.ats.txoj.logging.txojLoggerI18N] [com.arjuna.ats.internal.txoj.recovery.TORecoveryModule_6] - TORecoveryModule - second pass
      2009-02-26 06:05:15,850 INFO [com.arjuna.ats.jts.logging.loggerI18N] [com.arjuna.ats.internal.jts.recovery.transactions.TopLevelTransactionRecoveryModule_4] [com.arjuna.ats.internal.jts.recovery.transactions.TopLevelTransactionRecoveryModule_4] - TopLevelTransactionRecoveryModule Second Pass
      2009-02-26 06:05:15,850 INFO [com.arjuna.ats.jts.logging.logger] TransactionRecoveryModule.periodicWorkSecondPass()
      2009-02-26 06:05:15,850 INFO [com.arjuna.ats.jts.logging.loggerI18N] [com.arjuna.ats.internal.jts.recovery.transactions.ServerTransactionRecoveryModule_4] [com.arjuna.ats.internal.jts.recovery.transactions.ServerTransactionRecoveryModule_4] - ServerTransactionRecoveryModule - Second Pass
      2009-02-26 06:05:15,850 INFO [com.arjuna.ats.jta.logging.loggerI18N] [com.arjuna.ats.internal.jta.recovery.info.secondpass] JTS XARecoveryModule - second pass
      2009-02-26 06:06:06,367 DEBUG [org.mule.transaction.TransactionTemplate] Transaction is marked for rollback
      2009-02-26 06:06:06,367 DEBUG [org.mule.transaction.XaTransaction] Rolling back transaction
      2009-02-26 06:06:06,383 DEBUG [org.mule.providers.jms.xa.ConnectionFactoryWrapper] Invoking public native int java.lang.Object.hashCode()
      2009-02-26 06:06:06,383 DEBUG [org.mule.providers.jms.xa.ConnectionFactoryWrapper] Invoking public boolean java.lang.Object.equals(java.lang.Object)
      2009-02-26 06:06:06,383 DEBUG [org.mule.providers.jms.xa.ConnectionFactoryWrapper] Invoking public boolean java.lang.Object.equals(java.lang.Object)
      2009-02-26 06:06:06,383 DEBUG [org.mule.providers.jms.xa.ConnectionFactoryWrapper] Invoking public native int java.lang.Object.hashCode()
      2009-02-26 06:06:06,383 DEBUG [org.mule.providers.jms.xa.ConnectionFactoryWrapper] Invoking public boolean java.lang.Object.equals(java.lang.Object)
      2009-02-26 06:06:06,383 DEBUG [org.mule.providers.jms.xa.ConnectionFactoryWrapper] Invoking public boolean java.lang.Object.equals(java.lang.Object)
      2009-02-26 06:06:06,383 DEBUG [org.mule.providers.jms.xa.ConnectionFactoryWrapper] Invoking public abstract void javax.transaction.xa.XAResource.end(javax.transaction.xa.Xid,int) throws javax.transaction.xa.XAException
      2009-02-26 06:06:06,383 DEBUG [org.mule.providers.jms.xa.ConnectionFactoryWrapper] Invoking public abstract void javax.transaction.xa.XAResource.rollback(javax.transaction.xa.Xid) throws javax.transaction.xa.XAException
      2009-02-26 06:06:06,383 DEBUG [org.mule.transaction.TransactionTemplate] Beginning transaction
      2009-02-26 06:06:06,383 DEBUG [org.mule.transaction.XaTransaction] Beginning transaction
      2009-02-26 06:06:06,383 WARN [jacorb.poa.controller] rid: 354 opname: create_subtransaction cannot process request, because object doesn't exist
      2009-02-26 06:06:06,383 WARN [jacorb.poa.controller] rid: 354 opname: create_subtransaction request rejected with exception:
      2009-02-26 06:06:06,398 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@15914f3, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@1c78f98{ url=null ,addedOrder=0}
      2009-02-26 06:06:06,398 DEBUG [org.mule.config.i18n.Messages] Loading resource bundle: META-INF.services.org.mule.i18n.core-messages for locale en_US
      2009-02-26 06:06:06,398 DEBUG [org.mule.config.i18n.Messages] Loading resource bundle: META-INF.services.org.mule.i18n.core-messages for locale en_US
      2009-02-26 06:06:06,398 DEBUG [org.mule.providers.jms.xa.ConnectionFactoryWrapper] Invoking public abstract void javax.jms.MessageConsumer.close() throws javax.jms.JMSException
      2009-02-26 06:06:06,398 DEBUG [org.mule.providers.jms.xa.ConnectionFactoryWrapper] Invoking public abstract void javax.jms.Session.close() throws javax.jms.JMSException
      2009-02-26 06:06:06,398 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@15914f3, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@a47962{ url=null ,addedOrder=0}
      2009-02-26 06:06:06,398 DEBUG [org.mule.config.i18n.Messages] Loading resource bundle: META-INF.services.org.mule.i18n.core-messages for locale en_US
      2009-02-26 06:06:06,398 DEBUG [org.mule.config.i18n.Messages] Loading resource bundle: META-INF.services.org.mule.i18n.core-messages for locale en_US
      2009-02-26 06:06:06,414 ERROR [org.mule.impl.DefaultExceptionStrategy]
      ********************************************************************************
      Message : Can not start XA transaction
      Type : org.mule.umo.TransactionException
      Code : MULE_ERROR-90096
      JavaDoc : http://mule.mulesource.org/docs/apidocs/org/mule/umo/TransactionException.html
      ********************************************************************************
      Exception stack is:
      1. org.omg.CORBA.INVALID_TRANSACTION: vmcid: 0x4000 minor code: 3617 completed: No (javax.transaction.SystemException)
      com.arjuna.ats.internal.jta.transaction.jts.BaseTransaction:138 (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/transaction/SystemException.html)
      2. Can not start XA transaction (org.mule.umo.TransactionException)
      org.mule.transaction.XaTransaction:75 (http://mule.mulesource.org/docs/apidocs/org/mule/umo/TransactionException.html)
      ********************************************************************************
      Root Exception stack trace:
      javax.transaction.SystemException: org.omg.CORBA.INVALID_TRANSACTION: vmcid: 0x4000 minor code: 3617 completed: No
      at com.arjuna.ats.internal.jta.transaction.jts.BaseTransaction.begin(BaseTransaction.java:138)
      at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.begin(BaseTransactionManagerDelegate.java:77)
      at org.mule.transaction.XaTransaction.doBegin(XaTransaction.java:67)
      at org.mule.transaction.AbstractTransaction.begin(AbstractTransaction.java:78)
      at org.mule.transaction.XaTransactionFactory.beginTransaction(XaTransactionFactory.java:36)
      at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:67)
      at org.mule.providers.TransactedPollingMessageReceiver.poll(TransactedPollingMessageReceiver.java:103)
      at org.mule.providers.jms.TransactedJmsMessageReceiver.poll(TransactedJmsMessageReceiver.java:163)
      at org.mule.providers.AbstractPollingMessageReceiver.run(AbstractPollingMessageReceiver.java:116)
      at edu.emory.mathcs.backport.java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
      at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.runAndReset(FutureTask.java:198)
      at edu.emory.mathcs.backport.java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:138)
      at edu.emory.mathcs.backport.java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:238)
      at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:987)
      at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:528)
      at java.lang.Thread.run(Thread.java:595)

      ********************************************************************************


        • 1. Re: Jboss 4.2 not supporting XA transaction
          Faisal Faizan Newbie

          I am using the following settings for my SQL Server database and TIBCO EMS Server in JBoss

          *** For DataSource ****

          <datasources>
           <local-tx-datasource>
           <jndi-name>TPStatusJDBCDataSource</jndi-name>
           <connection-url>jdbc:sqlserver://VSDDBU11D:2015;DatabaseName=TPtest</connection-url>
           <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
           <user-name>user</user-name>
           <password>pwd</password>
          
           <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
           <metadata>
           <type-mapping>MS SQLSERVER2000</type-mapping>
           </metadata>
           </local-tx-datasource>
          
          </datasources>
          

          *** Defining a TIBCO EMS provider ****
          <connection-factories>
          
          <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
           name="jboss.mq:service=JMSProviderLoader,name=TibjmsProvider,server=localhost">
           <attribute name="ProviderName">TibcoJMSProvider</attribute>
           <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
           <attribute name="QueueFactoryRef">XAQueueConnectionFactory</attribute>
           <attribute name="TopicFactoryRef">XATopicConnectionFactory</attribute>
          
           <attribute name="Properties">
           java.naming.factory.initial=com.tibco.tibjms.naming.TibjmsInitialContextFactory
           java.naming.security.principal=user
           java.naming.security.credentials=pwd
           java.naming.provider.url=tcp://rvdlx4:110,tcp://rvdlx4:1101
           </attribute>
           </mbean>
          
          </connection-factories>
          


          ***** Attaching the TIBCO EMS Provider with factory *******
           <tx-connection-factory>
           <jndi-name>JmsXA</jndi-name>
           <xa-transaction></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.Queue</config-property>
           <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/TIBCOJMSProvider</config-property>
           <max-pool-size>20</max-pool-size>
           <security-domain-and-application>JmsXARealm</security-domain-and-application>
           </tx-connection-factory>