0 Replies Latest reply on Jan 9, 2007 2:40 PM by Tim Fite

    JBoss AS 4.0.5 XA Datasource problem

    Tim Fite Newbie

      Hopefully someone can lend me some help. I've come across a problem while upgrading from JBoss AS 3.x to JBoss AS 4.0.5 GA.

      I have a MDB that is creating both non-XA and XA Datasource connections in the same MDB instance. This used to work in JBoss AS 3.2.3, but now in JBoss AS 4.0.5 it causes the following runtime exception:

      2007-01-09 11:32:12,410 ERROR [org.jboss.ejb.plugins.LogInterceptor] RuntimeException in method: public abstract void javax.jms.MessageListener.onMessage(javax.jms.Message):
      java.lang.IllegalStateException: Transaction has terminated TransactionImpl:XidImpl[FormatId=257, GlobalId=localhost/31, BranchQual=, localId=31]
      at org.jboss.tm.TransactionImpl.lock(TransactionImpl.java:834)
      at org.jboss.tm.TransactionImpl.associateCurrentThread(TransactionImpl.java:794)
      at org.jboss.tm.TxManager.associateThread(TxManager.java:497)
      at org.jboss.tm.TxManager.resume(TxManager.java:316)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:460)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
      at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:109)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
      at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:402)
      at org.jboss.ejb.Container.invoke(Container.java:954)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:987)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1287)
      at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:266)
      at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:905)
      at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:170)
      at org.jboss.mq.SpySession.run(SpySession.java:323)
      at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:194)
      at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
      at java.lang.Thread.run(Thread.java:595)
      2007-01-09 11:32:12,411 ERROR [org.jboss.ejb.plugins.jms.JMSContainerInvoker] Exception in JMSCI message listener
      javax.ejb.EJBException: RuntimeException
      at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:417)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:209)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
      at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:402)
      at org.jboss.ejb.Container.invoke(Container.java:954)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:987)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1287)
      at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:266)
      at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:905)
      at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:170)
      at org.jboss.mq.SpySession.run(SpySession.java:323)
      at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:194)
      at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.IllegalStateException: Transaction has terminated TransactionImpl:XidImpl[FormatId=257, GlobalId=localhost/31, BranchQual=, localId=31]
      at org.jboss.tm.TransactionImpl.lock(TransactionImpl.java:834)
      at org.jboss.tm.TransactionImpl.associateCurrentThread(TransactionImpl.java:794)
      at org.jboss.tm.TxManager.associateThread(TxManager.java:497)
      at org.jboss.tm.TxManager.resume(TxManager.java:316)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:460)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
      at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:109)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
      ... 12 more
      2007-01-09 11:32:12,412 ERROR [org.jboss.jms.asf.StdServerSession] failed to commit/rollback
      java.lang.IllegalStateException: Wrong tx association: expected TransactionImpl:XidImpl[FormatId=257, GlobalId=localhost/31, BranchQual=, localId=31] was null
      at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:325)
      at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:905)
      at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:170)
      at org.jboss.mq.SpySession.run(SpySession.java:323)
      at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:194)
      at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
      at java.lang.Thread.run(Thread.java:595)

      All Datasources are connecting to Oracle 10g databases. I've used the same oracle-ds.xml config file in both JBoss AS 3.2.3 and JBoss AS 4.0.5. The only difference in the environment is that I am running JBoss AS 3.2.3 with jdk 1.4 and JBoss AS 4.0.5 with jdk 1.5.

      In my oracle-ds.xml I'm using the <no-tx-datasource> ... </no-tx-datasource> schema objects for the non-XA Datasource and of course the <xa-datasource> ... </xa-datasource> for the XA Datasources involved in the transaction.

      Again this works fine in JBoss AS 3.2.3, but when I deploy this to JBoss 4.0.5 GA it fails.

      Any help would be appreciated.