3 Replies Latest reply on Jul 26, 2011 8:46 PM by thunder.farmer

    Problem with transactions after upgrade of JBoss AS (4.2.3 -> 5.1.0)

    kaneeec

      Our application was running on JBoss 4.2.3 and everything was fine. After changing the JBoss to 5.1.0, a strange problem occured.

       

      We use transacted JMS queues. There are many modules which work fine with the new version but one module doesn't. It handles the first message correctly and all next messages cause exceptions

       

      11:20:54,647 WARN  [loggerI18N] [com.arjuna.ats.internal.jta.transaction.arjunacore.xastart] [com.arjuna.ats.internal.jta.transaction.arjunacore.xastart] TransactionImple.enlistResource - xa_start  - caught:
       XAException.XAER_RMERR for < 131075, 27, 25, 4945551024848484848495899995655585210150484854529958499955102484848484849589999565558521015048485452995849101 >
      11:20:54,647 ERROR [STDERR] javax.transaction.xa.XAException: java.lang.Exception: Session is already associated with a transaction
      11:20:54,649 ERROR [STDERR]     at com.swiftmq.jms.v750.XAResourceImpl.start(Unknown Source)
      11:20:54,649 ERROR [STDERR]     at org.company.jmssupport.XAResourceProxy.start(XAResourceProxy.java:81)
      11:20:54,650 ERROR [STDERR]     at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:899)
      11:20:54,651 ERROR [STDERR]     at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:510
      

       

      Any ideas where might be the problem? I don't have a clue what causes it - if there is a bug in our application or in arjuna.

        • 1. Re: Problem with transactions after upgrade of JBoss AS (4.2.3 -> 5.1.0)
          thunder.farmer

          Hi,

           

          I have little experance with Jboss 4.

          I know there are some changes in JBoss 5 in implementation of JMS.

          Guessing from you error log, if you access the JMS queue by JNDI lookup, you can change your JMS connectfactory from "ConnectionFactory" to "JmsXA".

           

          If that's NOT it, you need to know how you access the queue.

           

          Are you using message driven bean? or jndi lookup?

          If you access the queue by jndi lookup, which connection factory you are using?

          Where is the JMS queue accessed?  standalone client or servlet or EJB?

          If EJB what's the transaction attribute of the EJB......

          • 2. Re: Problem with transactions after upgrade of JBoss AS (4.2.3 -> 5.1.0)
            kaneeec

            We have problem using JBOSS 5 and SwiftMQ 8.1. We are running EAR with POJOs that are using JBOSS TM and SwiftMQ.

            In code, we have - shortened to important rows:

             

             

            ...
            config.getTransactionManager().begin();
            ...
            Transaction t = jmsConnectivity.getTransaction();
            ...
            if (!inTransaction) {
                    t.registerSynchronization(this);
                    inTransaction = true;
            }
            ...
            logger.debug(this + " checking session and transaction ");
            if (session == tXASession && t == tTransaction) {
                    return;
            }
            logger.debug(this + " " + session + "=" + qXASession + " " + t + "=" + qTransaction
                                                    + " inTransaction=" + inTransaction);
            ...
            t.enlistResource(getProxy(xaResource));
            ...
            //code to send jms message to queue
            ...
            config.getTransactionManager().commit();
            ...
            

             

            This is performed once without a problem, but during the second iteration we get this exception:

             

            jms09Connection.client - object xx.xxx.jmssupport.JMSClient@22811e created qXASession=com.swiftmq.jms.v750.XAQueueSessionImpl@14b1008
            jms09Connection.client - xx.xxx.jmssupport.JMSClient@22811e checking session and transaction
            jms09Connection.client - xx.xxx.jmssupport.JMSClient@22811e com.swiftmq.jms.v750.XAQueueSessionImpl@14b1008=com.swiftmq.jms.v750.XAQueueSessionImpl@14b1008 TransactionImple < ac, BasicAction: 7f000001:8645:4e2d65a2:a status: ActionStatus.RUNNING >=null inTransaction=true
            jms09Connection.client - XAProxy.start called, resource=com.swiftmq.jms.v750.XAResourceImpl@11da1d1, xid=< 131075, 26, 24, 49455510248484848484958565452535852101501005453975058975510248484848484958565452535852101501005453975058102 >, int=0
            jms09Connection.client - XAProxy.isSameRM called, resource=com.swiftmq.jms.v750.XAResourceImpl@11da1d1 compared resource=xx.xxx.jmssupport.XAResourceProxy@1436982 result=true
            jms09Connection.client - XAProxy.end called, resource=com.swiftmq.jms.v750.XAResourceImpl@11da1d1, xid=< 131075, 26, 24, 49455510248484848484958565452535852101501005453975058975510248484848484958565452535852101501005453975058102 >, int=67108864
            jms09Connection.client - XAProxy.commit called, resource=com.swiftmq.jms.v750.XAResourceImpl@11da1d1, xid=< 131075, 26, 24, 49455510248484848484958565452535852101501005453975058975510248484848484958565452535852101501005453975058102 >, boolean=true
            jms09Connection.client - xx.xxx.jmssupport.JMSClient@22811e checking session and transaction
            jms09Connection.client - xx.xxx.jmssupport.JMSClient@22811e com.swiftmq.jms.v750.XAQueueSessionImpl@14b1008=com.swiftmq.jms.v750.XAQueueSessionImpl@14b1008 TransactionImple < ac, BasicAction: 7f000001:8645:4e2d65a2:1a status: ActionStatus.RUNNING >=TransactionImple < ac, BasicAction: 7f000001:8645:4e2d65a2:a status: ActionStatus.COMMITTED > inTransaction=true
            jms09Connection.client - XAProxy.start called, resource=com.swiftmq.jms.v750.XAResourceImpl@11da1d1, xid=< 131075, 27, 25, 49455510248484848484958565452535852101501005453975058499755102484848484849585654525358521015010054539750584999 >, int=0
            jms09Connection.client - XAProxy.isSameRM called, resource=com.swiftmq.jms.v750.XAResourceImpl@11da1d1 compared resource=xx.xxx.jmssupport.XAResourceProxy@1436982 result=true
            WARN  [ATBridgeService.0] () com.arjuna.ats.jta.logging.loggerI18N - [com.arjuna.ats.internal.jta.transaction.arjunacore.xastart] [com.arjuna.ats.internal.jta.transaction.arjunacore.xastart] TransactionImple.enlistResource - xa_start  - caught: XAException.XAER_RMERR for < 131075, 27, 25, 49455510248484848484958565452535852101501005453975058499755102484848484849585654525358521015010054539750584999 >
            ERROR [ATBridgeService.0] () STDERR - javax.transaction.xa.XAException: java.lang.Exception: Session is already associated with a transaction
            ERROR [ATBridgeService.0] () STDERR -      at com.swiftmq.jms.v750.XAResourceImpl.start(Unknown Source)
            ERROR [ATBridgeService.0] () STDERR -      at xx.xxx.jmssupport.XAResourceProxy.start(XAResourceProxy.java:99)
            ERROR [ATBridgeService.0] () STDERR -      at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:899)
            ERROR [ATBridgeService.0] () STDERR -      at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:510)
            ERROR [ATBridgeService.0] () STDERR -      at xx.xxx.jmssupport.JMSClient.enlist(JMSClient.java:310)
            jms09Connection.client - XAProxy.end called, resource=com.swiftmq.jms.v750.XAResourceImpl@11da1d1, xid=< 131075, 27, 25, 49455510248484848484958565452535852101501005453975058499755102484848484849585654525358521015010054539750584999 >, int=67108864
            jms09Connection.client - XAProxy.rollback called, resource=com.swiftmq.jms.v750.XAResourceImpl@11da1d1, xid=< 131075, 27, 25, 49455510248484848484958565452535852101501005453975058499755102484848484849585654525358521015010054539750584999 >
            

             

            Does anybody have an idea what can be wrong or if there is bug in swift/JBoss or are we doing something wrong?

            • 3. Re: Problem with transactions after upgrade of JBoss AS (4.2.3 -> 5.1.0)
              thunder.farmer

              I think you are runing into trouble....

              Where is this piece of code is called? EJB or standalone client?

               

              see if below links help

               

              http://jcp.org/en/jsr/detail?id=343

               

              section 2.5

               

              http://download.oracle.com/javaee/1.4/api/javax/jms/XAConnectionFactory.html

              For example, the JMS 1.1 specification states that a JMS connection can be used to create multiple sessions. However the EJB 3.1 specification states that a JMS connection can be used to create only one session. Experience has shown that this is confusing for some users, who read the JMS API or specification only to find that some of it does not apply. There are also some aspects (such as the correct behaviour when there is no transactional context) which are not fully specified in the EJB or other specifications.