10 Replies Latest reply on Oct 15, 2002 3:50 PM by Doug

    XAException although LocalTX

    waltraud buettner Newbie

      Hello,
      I'm using JBoss3.0 and a Resource Adapter other than JDBC. I finally managed to configure the RA that JBoss accepts it. Now I start my client program, but unfortunately I get an XAException when I do the JTA.commit in my EJBean. I wonder, because I use LocalTx. This program runs fine under Weblogic, so there shouldn't be a general problem with it. Any idea why the commit is refused? Why is the xid wrong? Where does it come from?

      This is my exception:
      13:56:29,305 INFO [STDOUT] CounterBean: now commit transaction
      13:56:29,305 WARN [TxCapsule] XAException: tx=XidImpl [FormatId=257, GlobalId=PCWBU3//0, BranchQual=] errorCo
      de=XA_UNKNOWN(0)
      javax.transaction.xa.XAException: wrong xid in rollback: expected: null, got: XidImpl [FormatId=257, GlobalId=
      PCWBU3//0, BranchQual=1]
      at org.jboss.resource.connectionmanager.LocalTxConnectionManager$LocalConnectionEventListener.rollback
      (LocalTxConnectionManager.java:640)
      at org.jboss.tm.TxCapsule.rollbackResources(TxCapsule.java:1721)
      at org.jboss.tm.TxCapsule.commit(TxCapsule.java:316)
      at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:74)
      at org.jboss.tm.TxManager.commit(TxManager.java:138)
      at org.jboss.ejb.EnterpriseContext$UserTransactionImpl.commit(EnterpriseContext.java:439)
      ... etc.


      thanks,
      Waltraud

        • 1. 3849642
          David Jencks Master

          I'm controlling the local transaction from the tx manager by implementing an XAResource in the ConnectionEventListener: prepare does nothing except warn you, commit/rollback forward the operation to the LocalTransaction.

          I don't have any immediate ideas about why this is showing up. Any more details, code, or testcase you can provide would be welcome. Apparently the TxCapsule had commit called while the tx was set rollback only. Do you have any idea how this state was set?

          davidjencks@directvinternet.com if you want to send stuff privately

          • 2. Re: XAException although LocalTX
            waltraud buettner Newbie

            sorry I have not posted the whole exception: I catch the exception in my Bean and the message is:
            "Already marked for rollback";
            What I do is the following:
            -get usertransaction
            -begin usertransaction
            -lookup resource reference
            -getConnection
            -query in database
            -commit usertransaction

            I have no clue why rollback only is set.


            Here mywhole exception:

            15:03:58,363 INFO [STDOUT] CounterBean: now commit transaction
            15:03:58,378 WARN [TxCapsule] XAException: tx=XidImpl [FormatId=257, GlobalId=PCWBU3//0, BranchQual=] errorCo
            de=XA_UNKNOWN(0)
            javax.transaction.xa.XAException: wrong xid in rollback: expected: null, got: XidImpl [FormatId=257, GlobalId=
            PCWBU3//0, BranchQual=1]
            at org.jboss.resource.connectionmanager.LocalTxConnectionManager$LocalConnectionEventListener.rollback
            (LocalTxConnectionManager.java:640)
            at org.jboss.tm.TxCapsule.rollbackResources(TxCapsule.java:1721)
            at org.jboss.tm.TxCapsule.commit(TxCapsule.java:316)
            at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:74)
            at org.jboss.tm.TxManager.commit(TxManager.java:138)
            at org.jboss.ejb.EnterpriseContext$UserTransactionImpl.commit(EnterpriseContext.java:439)
            at mypackage.db.api.connector.examples.managed.localTx.CounterBean.list(Unknown Source)
            at java.lang.reflect.Method.invoke(Native Method)
            at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulSessionContainer.java:82
            3)
            at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:129)
            at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor
            .java:186)
            at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:96)
            at org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxInterceptorBMT.java:144)
            at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:62)
            at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceInterceptor.
            java:266)
            at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
            at org.jboss.ejb.StatefulSessionContainer.invoke(StatefulSessionContainer.java:380)
            at org.jboss.ejb.Container.invoke(Container.java:705)
            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
            at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:362)
            at java.lang.reflect.Method.invoke(Native Method)
            at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
            at sun.rmi.transport.Transport$1.run(Transport.java:152)
            at java.security.AccessController.doPrivileged(Native Method)
            at sun.rmi.transport.Transport.serviceCall(Transport.java:148)
            at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:465)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:706)
            at java.lang.Thread.run(Thread.java:484)
            15:03:58,394 INFO [STDOUT] CounterBean: caught Exception, msg is: Already marked for rollback
            15:03:58,394 ERROR [STDERR] javax.transaction.RollbackException: Already marked for rollback
            15:03:58,394 ERROR [STDERR] at org.jboss.tm.TxCapsule.commit(TxCapsule.java:321)
            15:03:58,394 ERROR [STDERR] at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:74)
            15:03:58,394 ERROR [STDERR] at org.jboss.tm.TxManager.commit(TxManager.java:138)
            15:03:58,394 ERROR [STDERR] at org.jboss.ejb.EnterpriseContext$UserTransactionImpl.commit(EnterpriseContex
            t.java:439)
            15:03:58,394 ERROR [STDERR] at mypackage.db.api.connector.examples.managed.localTx.CounterBean
            .list(Unknown Source)
            15:03:58,394 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method)
            15:03:58,394 ERROR [STDERR] at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(Stateful
            SessionContainer.java:823)
            15:03:58,394 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:1
            29)
            15:03:58,394 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(Cac
            hedConnectionInterceptor.java:186)
            15:03:58,394 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxIntercepto
            r.java:96)
            15:03:58,394 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxInterce
            ptorBMT.java:144)
            15:03:58,394 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:62)
            15:03:58,394 ERROR [STDERR] at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSes
            sionInstanceInterceptor.java:266)
            15:03:58,394 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
            15:03:58,394 ERROR [STDERR] at org.jboss.ejb.StatefulSessionContainer.invoke(StatefulSessionContainer.java
            :380)
            15:03:58,394 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:705)
            15:03:58,394 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
            15:03:58,394 ERROR [STDERR] at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:362)
            15:03:58,394 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method)
            15:03:58,394 ERROR [STDERR] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
            15:03:58,394 ERROR [STDERR] at sun.rmi.transport.Transport$1.run(Transport.java:152)
            15:03:58,394 ERROR [STDERR] at java.security.AccessController.doPrivileged(Native Method)
            15:03:58,394 ERROR [STDERR] at sun.rmi.transport.Transport.serviceCall(Transport.java:148)
            15:03:58,394 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:465)
            15:03:58,394 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:
            706)
            15:03:58,409 ERROR [STDERR] at java.lang.Thread.run(Thread.java:484)
            15:05:48,547 DEBUG [LRUEnterpriseContextCachePolicy] Resized cache for bean CounterBean: old capacity = 100000

            Any idea?

            thanks,
            Waltraud

            • 3. Re: XAException although LocalTX
              David Jencks Master

              I still have no idea. Does it make any difference if you close the connection before committing? (It shouldn't, but I don't know why this is happening anyway).

              Does the query execute successfully? Does it rollback if you comment out the query execution? Is all the code in one method of one ejb?

              • 4. Re: XAException although LocalTX
                waltraud buettner Newbie

                - yes the query executes successfully
                - yes the whole code is in one business method of the bean

                I'll try the close before commit and the whole thing without any database access.
                Could time be a problem? If yes, is there a way that I set the timeout to a higher value?

                thanks for your help,
                Waltraud

                • 5. Re: XAException although LocalTX
                  waltraud buettner Newbie

                  It doesn't make a difference if I execute a close before the commit, the same exception occurs.
                  Even if I make no query just a
                  - begin tx
                  - lookup
                  - getconnection
                  - close
                  - commit
                  I get the same error: "Already marked for rollback"?

                  • 6. Re: XAException although LocalTX
                    David Jencks Master

                    I'm mystified. Can you turn logging up to trace and see if you can get any more info?

                    It does work ok if you just do
                    -begin tx
                    -commit tx?

                    How about
                    -begin tx
                    -lookup
                    -commit

                    and
                    -begin
                    -lookup
                    -getConnection
                    -commit

                    Thanks
                    david jencks

                    • 7. Re: XAException although LocalTX
                      waltraud buettner Newbie

                      Hello David,
                      I tried to switch on trace, the output see below.
                      The question is still:
                      Why is the status set to STATUS_MARKED_ROLLBACK?
                      I found that this status is set in TxCapsule only, but there several times in several situations.
                      If I exclude timedOut(), rollback(), setRollbackOnly() and delistResources(), as well as startResource().

                      Is prepareResources() a good place to start investigation ?


                      As I already mentioned my Resource adapter and the example Bean works fine with Weblogic.

                      :
                      09:39:07,539 INFO [Server] JBoss (MX MicroKernel) [3.0.0 Date:200205311035] Started in 0m:19s:485ms

                      09:40:26,210 INFO [STDOUT] CounterBean: setSessionContext called
                      09:40:26,226 INFO [STDOUT] CounterBean: ejbCreate called
                      09:40:26,273 INFO [STDOUT] CounterBean: in list
                      09:40:26,273 INFO [STDOUT] CounterBean: got userTransaction
                      09:40:26,273 INFO [STDOUT] CounterBean: now begin transaction
                      09:40:26,320 INFO [STDOUT] CounterBean: in list, started transaction
                      09:40:26,320 INFO [STDOUT] CounterBean: now create new InitialContext
                      09:40:26,320 INFO [STDOUT] CounterBean: look up resource reference: java:comp/env/eis/MyLocalTxConnector
                      09:40:26,320 INFO [STDOUT] CounterBean: looked up resource reference: java:comp/env/eis/MyLocalTxConnector
                      09:40:26,320 INFO [LocalTxConnectionManager] getManagedConnection returning unassociated connection

                      09:40:26,351 DEBUG [IdleRemover] internalRegisterPool: registering pool with interval 900000 old int
                      erval: 9223372036854775807
                      09:40:26,351 DEBUG [IdleRemover] internalRegisterPool: about to notify thread: old next: 10252504763
                      51, new next: 1025250476351
                      09:40:26,742 INFO [LocalTxConnectionManager$LocalConnectionEventListener] enlisting currenttx: Tran
                      sactionImpl:XidImpl [FormatId=257, GlobalId=PCWBU3//0, BranchQual=], cel: org.jboss.resource.connect
                      ionmanager.LocalTxConnectionManager$LocalConnectionEventListener@e7c9e
                      09:40:26,835 INFO [STDOUT] CounterBean: got connection: com.softwareag.tamino.db.api.connector.TCon
                      nectionWrapper@3e4663
                      09:40:26,835 INFO [STDOUT] CounterBean: in list: now instantiate Counter
                      09:40:26,835 INFO [STDOUT] CounterBean: in list: now call Counter.list()
                      09:40:26,835 INFO [STDOUT] CounterBean: now close connection
                      09:40:26,835 INFO [STDOUT] CounterBean: now commit transaction
                      09:40:26,835 WARN [TxCapsule] XAException: tx=XidImpl [FormatId=257, GlobalId=PCWBU3//0, BranchQual
                      =] errorCode=XA_UNKNOWN(0)
                      javax.transaction.xa.XAException: wrong xid in rollback: expected: null, got: XidImpl [FormatId=257,
                      GlobalId=PCWBU3//0, BranchQual=1]
                      at org.jboss.resource.connectionmanager.LocalTxConnectionManager$LocalConnectionEventListene
                      r.rollback(LocalTxConnectionManager.java:640)
                      at org.jboss.tm.TxCapsule.rollbackResources(TxCapsule.java:1721)
                      at org.jboss.tm.TxCapsule.commit(TxCapsule.java:316)
                      at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:74)
                      at org.jboss.tm.TxManager.commit(TxManager.java:138)
                      at org.jboss.ejb.EnterpriseContext$UserTransactionImpl.commit(EnterpriseContext.java:439)
                      at mypackage.db.api.connector.examples.managed.localTx.CounterBean.list(CounterB
                      ean.java:169)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulSessionContain
                      er.java:823)
                      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:129)
                      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionI
                      nterceptor.java:186)
                      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:96)
                      at org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxInterceptorBMT.java:1
                      44)
                      at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:62)
                      at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceIn
                      terceptor.java:266)
                      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
                      at org.jboss.ejb.StatefulSessionContainer.invoke(StatefulSessionContainer.java:380)
                      at org.jboss.ejb.Container.invoke(Container.java:705)
                      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
                      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:362)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
                      at sun.rmi.transport.Transport$1.run(Transport.java:152)
                      at java.security.AccessController.doPrivileged(Native Method)
                      at sun.rmi.transport.Transport.serviceCall(Transport.java:148)
                      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:465)
                      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:706)
                      at java.lang.Thread.run(Thread.java:484)
                      09:40:26,835 INFO [STDOUT] CounterBean: caught Exception, msg is: Already marked for rollback
                      09:40:26,835 ERROR [STDERR] javax.transaction.RollbackException: Already marked for rollback
                      09:40:26,835 ERROR [STDERR] at org.jboss.tm.TxCapsule.commit(TxCapsule.java:321)
                      09:40:26,835 ERROR [STDERR] at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:74)
                      09:40:26,835 ERROR [STDERR] at org.jboss.tm.TxManager.commit(TxManager.java:138)
                      09:40:26,835 ERROR [STDERR] at org.jboss.ejb.EnterpriseContext$UserTransactionImpl.commit(Enterp
                      riseContext.java:439)
                      09:40:26,835 ERROR [STDERR] at mypackage.db.api.connector.examples.managed.localTx.C
                      ounterBean.list(CounterBean.java:169)
                      09:40:26,835 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method)
                      09:40:26,835 ERROR [STDERR] at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invok
                      e(StatefulSessionContainer.java:823)
                      09:40:26,835 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityIntercep
                      tor.java:129)
                      09:40:26,835 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.
                      invoke(CachedConnectionInterceptor.java:186)
                      09:40:26,835 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTx
                      Interceptor.java:96)
                      09:40:26,835 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(Abstrac
                      tTxInterceptorBMT.java:144)
                      09:40:26,835 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.ja
                      va:62)
                      09:40:26,835 ERROR [STDERR] at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(S
                      tatefulSessionInstanceInterceptor.java:266)
                      09:40:26,835 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:1
                      66)
                      09:40:26,851 ERROR [STDERR] at org.jboss.ejb.StatefulSessionContainer.invoke(StatefulSessionCont
                      ainer.java:380)
                      09:40:26,851 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:705)
                      09:40:26,851 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:4
                      91)
                      09:40:26,851 ERROR [STDERR] at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.j
                      ava:362)
                      09:40:26,851 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method)
                      09:40:26,851 ERROR [STDERR] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:24
                      1)
                      09:40:26,851 ERROR [STDERR] at sun.rmi.transport.Transport$1.run(Transport.java:152)
                      09:40:26,851 ERROR [STDERR] at java.security.AccessController.doPrivileged(Native Method)
                      09:40:26,851 ERROR [STDERR] at sun.rmi.transport.Transport.serviceCall(Transport.java:148)
                      09:40:26,851 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.ja
                      va:465)
                      09:40:26,851 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTrans
                      port.java:706)
                      09:40:26,851 ERROR [STDERR] at java.lang.Thread.run(Thread.java:484)
                      09:42:07,726 DEBUG [LRUEnterpriseContextCachePolicy] Resized cache for bean CounterBean: old capacit
                      y = 1000000, new capacity = 50


                      thanks,
                      Waltraud

                      • 8. Re: XAException although LocalTX
                        waltraud buettner Newbie

                        ok my answer disappeared the second time, but I try again.

                        The problem is still the Status: STATUS_MARKED_ROLLBACK;
                        I found out, that this is set only in class TxCapsule.

                        If I exclude timedOut() and the rollback methods, is
                        prepareResources() a good place to start problem investigation?

                        Here is my trace:
                        09:40:26,210 INFO [STDOUT] CounterBean: setSessionContext called
                        09:40:26,226 INFO [STDOUT] CounterBean: ejbCreate called
                        09:40:26,273 INFO [STDOUT] CounterBean: in list
                        09:40:26,273 INFO [STDOUT] CounterBean: got userTransaction
                        09:40:26,273 INFO [STDOUT] CounterBean: now begin transaction
                        09:40:26,320 INFO [STDOUT] CounterBean: in list, started transaction
                        09:40:26,320 INFO [STDOUT] CounterBean: now create new InitialContext
                        09:40:26,320 INFO [STDOUT] CounterBean: look up resource reference: java:comp/env/eis/MyLocalTxConnector
                        09:40:26,320 INFO [STDOUT] CounterBean: looked up resource reference: java:comp/env/eis/MyLocalTxConnector
                        09:40:26,320 INFO [LocalTxConnectionManager] getManagedConnection returning unassociated connection

                        09:40:26,351 DEBUG [IdleRemover] internalRegisterPool: registering pool with interval 900000 old int
                        erval: 9223372036854775807
                        09:40:26,351 DEBUG [IdleRemover] internalRegisterPool: about to notify thread: old next: 10252504763
                        51, new next: 1025250476351
                        09:40:26,742 INFO [LocalTxConnectionManager$LocalConnectionEventListener] enlisting currenttx: Tran
                        sactionImpl:XidImpl [FormatId=257, GlobalId=PCWBU3//0, BranchQual=], cel: org.jboss.resource.connect
                        ionmanager.LocalTxConnectionManager$LocalConnectionEventListener@e7c9e
                        09:40:26,835 INFO [STDOUT] CounterBean: got connection: com.softwareag.tamino.db.api.connector.TCon
                        nectionWrapper@3e4663
                        09:40:26,835 INFO [STDOUT] CounterBean: in list: now instantiate Counter
                        09:40:26,835 INFO [STDOUT] CounterBean: in list: now call Counter.list()
                        09:40:26,835 INFO [STDOUT] CounterBean: now close connection
                        09:40:26,835 INFO [STDOUT] CounterBean: now commit transaction
                        09:40:26,835 WARN [TxCapsule] XAException: tx=XidImpl [FormatId=257, GlobalId=PCWBU3//0, BranchQual
                        =] errorCode=XA_UNKNOWN(0)
                        javax.transaction.xa.XAException: wrong xid in rollback: expected: null, got: XidImpl [FormatId=257,
                        GlobalId=PCWBU3//0, BranchQual=1]
                        at org.jboss.resource.connectionmanager.LocalTxConnectionManager$LocalConnectionEventListene
                        r.rollback(LocalTxConnectionManager.java:640)
                        at org.jboss.tm.TxCapsule.rollbackResources(TxCapsule.java:1721)
                        at org.jboss.tm.TxCapsule.commit(TxCapsule.java:316)
                        at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:74)
                        at org.jboss.tm.TxManager.commit(TxManager.java:138)
                        at org.jboss.ejb.EnterpriseContext$UserTransactionImpl.commit(EnterpriseContext.java:439)
                        at db.api.connector.examples.managed.localTx.CounterBean.list(CounterB
                        ean.java:169)
                        at java.lang.reflect.Method.invoke(Native Method)
                        at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulSessionContain
                        er.java:823)
                        at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:129)
                        at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionI
                        nterceptor.java:186)
                        at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:96)
                        at org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxInterceptorBMT.java:1
                        44)
                        at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:62)
                        at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceIn
                        terceptor.java:266)
                        at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
                        at org.jboss.ejb.StatefulSessionContainer.invoke(StatefulSessionContainer.java:380)
                        at org.jboss.ejb.Container.invoke(Container.java:705)
                        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
                        at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:362)
                        at java.lang.reflect.Method.invoke(Native Method)
                        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
                        at sun.rmi.transport.Transport$1.run(Transport.java:152)
                        at java.security.AccessController.doPrivileged(Native Method)
                        at sun.rmi.transport.Transport.serviceCall(Transport.java:148)
                        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:465)
                        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:706)
                        at java.lang.Thread.run(Thread.java:484)
                        09:40:26,835 INFO [STDOUT] CounterBean: caught Exception, msg is: Already marked for rollback
                        09:40:26,835 ERROR [STDERR] javax.transaction.RollbackException: Already marked for rollback
                        09:40:26,835 ERROR [STDERR] at org.jboss.tm.TxCapsule.commit(TxCapsule.java:321)
                        09:40:26,835 ERROR [STDERR] at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:74)
                        09:40:26,835 ERROR [STDERR] at org.jboss.tm.TxManager.commit(TxManager.java:138)
                        09:40:26,835 ERROR [STDERR] at org.jboss.ejb.EnterpriseContext$UserTransactionImpl.commit(Enterp
                        riseContext.java:439)
                        09:40:26,835 ERROR [STDERR] at db.api.connector.examples.managed.localTx.C
                        ounterBean.list(CounterBean.java:169)
                        09:40:26,835 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method)
                        09:40:26,835 ERROR [STDERR] at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invok
                        e(StatefulSessionContainer.java:823)
                        09:40:26,835 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityIntercep
                        tor.java:129)
                        09:40:26,835 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.
                        invoke(CachedConnectionInterceptor.java:186)
                        09:40:26,835 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTx
                        Interceptor.java:96)
                        09:40:26,835 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(Abstrac
                        tTxInterceptorBMT.java:144)
                        09:40:26,835 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.ja
                        va:62)
                        09:40:26,835 ERROR [STDERR] at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(S
                        tatefulSessionInstanceInterceptor.java:266)
                        09:40:26,835 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:1
                        66)
                        09:40:26,851 ERROR [STDERR] at org.jboss.ejb.StatefulSessionContainer.invoke(StatefulSessionCont
                        ainer.java:380)
                        09:40:26,851 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:705)
                        09:40:26,851 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:4
                        91)
                        09:40:26,851 ERROR [STDERR] at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.j
                        ava:362)
                        09:40:26,851 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method)
                        09:40:26,851 ERROR [STDERR] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:24
                        1)
                        09:40:26,851 ERROR [STDERR] at sun.rmi.transport.Transport$1.run(Transport.java:152)
                        09:40:26,851 ERROR [STDERR] at java.security.AccessController.doPrivileged(Native Method)
                        09:40:26,851 ERROR [STDERR] at sun.rmi.transport.Transport.serviceCall(Transport.java:148)
                        09:40:26,851 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.ja
                        va:465)
                        09:40:26,851 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTrans
                        port.java:706)
                        09:40:26,851 ERROR [STDERR] at java.lang.Thread.run(Thread.java:484)

                        • 9. Re: XAException although LocalTX
                          waltraud buettner Newbie

                          ok my answer disappeared the third time, but I try again.

                          The problem is still the Status: STATUS_MARKED_ROLLBACK;
                          I found out, that this is set only in class TxCapsule.

                          If I exclude timedOut() and the rollback methods, is
                          prepareResources() a good place to start problem investigation?

                          Here is my trace:
                          09:40:26,210 INFO [STDOUT] CounterBean: setSessionContext called
                          09:40:26,226 INFO [STDOUT] CounterBean: ejbCreate called
                          09:40:26,273 INFO [STDOUT] CounterBean: in list
                          09:40:26,273 INFO [STDOUT] CounterBean: got userTransaction
                          09:40:26,273 INFO [STDOUT] CounterBean: now begin transaction
                          09:40:26,320 INFO [STDOUT] CounterBean: in list, started transaction
                          09:40:26,320 INFO [STDOUT] CounterBean: now create new InitialContext
                          09:40:26,320 INFO [STDOUT] CounterBean: look up resource reference: java:comp/env/eis/MyLocalTxConnector
                          09:40:26,320 INFO [STDOUT] CounterBean: looked up resource reference: java:comp/env/eis/MyLocalTxConnector
                          09:40:26,320 INFO [LocalTxConnectionManager] getManagedConnection returning unassociated connection

                          09:40:26,351 DEBUG [IdleRemover] internalRegisterPool: registering pool with interval 900000 old int
                          erval: 9223372036854775807
                          09:40:26,351 DEBUG [IdleRemover] internalRegisterPool: about to notify thread: old next: 10252504763
                          51, new next: 1025250476351
                          09:40:26,742 INFO [LocalTxConnectionManager$LocalConnectionEventListener] enlisting currenttx: Tran
                          sactionImpl:XidImpl [FormatId=257, GlobalId=PCWBU3//0, BranchQual=], cel: org.jboss.resource.connect
                          ionmanager.LocalTxConnectionManager$LocalConnectionEventListener@e7c9e
                          09:40:26,835 INFO [STDOUT] CounterBean: got connection: com.softwareag.tamino.db.api.connector.TCon
                          nectionWrapper@3e4663
                          09:40:26,835 INFO [STDOUT] CounterBean: in list: now instantiate Counter
                          09:40:26,835 INFO [STDOUT] CounterBean: in list: now call Counter.list()
                          09:40:26,835 INFO [STDOUT] CounterBean: now close connection
                          09:40:26,835 INFO [STDOUT] CounterBean: now commit transaction
                          09:40:26,835 WARN [TxCapsule] XAException: tx=XidImpl [FormatId=257, GlobalId=PCWBU3//0, BranchQual
                          =] errorCode=XA_UNKNOWN(0)
                          javax.transaction.xa.XAException: wrong xid in rollback: expected: null, got: XidImpl [FormatId=257,
                          GlobalId=PCWBU3//0, BranchQual=1]
                          at org.jboss.resource.connectionmanager.LocalTxConnectionManager$LocalConnectionEventListene
                          r.rollback(LocalTxConnectionManager.java:640)
                          at org.jboss.tm.TxCapsule.rollbackResources(TxCapsule.java:1721)
                          at org.jboss.tm.TxCapsule.commit(TxCapsule.java:316)
                          at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:74)
                          at org.jboss.tm.TxManager.commit(TxManager.java:138)
                          at org.jboss.ejb.EnterpriseContext$UserTransactionImpl.commit(EnterpriseContext.java:439)
                          at db.api.connector.examples.managed.localTx.CounterBean.list(CounterB
                          ean.java:169)
                          at java.lang.reflect.Method.invoke(Native Method)
                          at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulSessionContain
                          er.java:823)
                          at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:129)
                          at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionI
                          nterceptor.java:186)
                          at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:96)
                          at org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxInterceptorBMT.java:1
                          44)
                          at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:62)
                          at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceIn
                          terceptor.java:266)
                          at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
                          at org.jboss.ejb.StatefulSessionContainer.invoke(StatefulSessionContainer.java:380)
                          at org.jboss.ejb.Container.invoke(Container.java:705)
                          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
                          at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:362)
                          at java.lang.reflect.Method.invoke(Native Method)
                          at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
                          at sun.rmi.transport.Transport$1.run(Transport.java:152)
                          at java.security.AccessController.doPrivileged(Native Method)
                          at sun.rmi.transport.Transport.serviceCall(Transport.java:148)
                          at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:465)
                          at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:706)
                          at java.lang.Thread.run(Thread.java:484)
                          09:40:26,835 INFO [STDOUT] CounterBean: caught Exception, msg is: Already marked for rollback
                          09:40:26,835 ERROR [STDERR] javax.transaction.RollbackException: Already marked for rollback
                          09:40:26,835 ERROR [STDERR] at org.jboss.tm.TxCapsule.commit(TxCapsule.java:321)
                          09:40:26,835 ERROR [STDERR] at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:74)
                          09:40:26,835 ERROR [STDERR] at org.jboss.tm.TxManager.commit(TxManager.java:138)
                          09:40:26,835 ERROR [STDERR] at org.jboss.ejb.EnterpriseContext$UserTransactionImpl.commit(Enterp
                          riseContext.java:439)
                          09:40:26,835 ERROR [STDERR] at db.api.connector.examples.managed.localTx.C
                          ounterBean.list(CounterBean.java:169)
                          09:40:26,835 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method)
                          09:40:26,835 ERROR [STDERR] at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invok
                          e(StatefulSessionContainer.java:823)
                          09:40:26,835 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityIntercep
                          tor.java:129)
                          09:40:26,835 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.
                          invoke(CachedConnectionInterceptor.java:186)
                          09:40:26,835 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTx
                          Interceptor.java:96)
                          09:40:26,835 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(Abstrac
                          tTxInterceptorBMT.java:144)
                          09:40:26,835 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.ja
                          va:62)
                          09:40:26,835 ERROR [STDERR] at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(S
                          tatefulSessionInstanceInterceptor.java:266)
                          09:40:26,835 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:1
                          66)
                          09:40:26,851 ERROR [STDERR] at org.jboss.ejb.StatefulSessionContainer.invoke(StatefulSessionCont
                          ainer.java:380)
                          09:40:26,851 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:705)
                          09:40:26,851 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:4
                          91)
                          09:40:26,851 ERROR [STDERR] at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.j
                          ava:362)
                          09:40:26,851 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method)
                          09:40:26,851 ERROR [STDERR] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:24
                          1)
                          09:40:26,851 ERROR [STDERR] at sun.rmi.transport.Transport$1.run(Transport.java:152)
                          09:40:26,851 ERROR [STDERR] at java.security.AccessController.doPrivileged(Native Method)
                          09:40:26,851 ERROR [STDERR] at sun.rmi.transport.Transport.serviceCall(Transport.java:148)
                          09:40:26,851 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.ja
                          va:465)
                          09:40:26,851 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTrans
                          port.java:706)
                          09:40:26,851 ERROR [STDERR] at java.lang.Thread.run(Thread.java:484)

                          • 10. Re: XAException although LocalTX
                            Doug Newbie

                            I am getting the same results with an adapter I have written that supports Local Transactions and using Bean managed transactions. I am using version 3.0.3

                            Has this problem been solved?

                            I get a similar problem if I use container managed transactions. As follows:


                            2002-10-15 10:40:17,118 WARN [org.jboss.tm.TxCapsule] XAException: tx=XidImpl [FormatId=257, GlobalId=108868d//5, BranchQual=] errorCode=XA_UNKNOWN(0)
                            javax.transaction.xa.XAException: wrong xid in rollback: expected: null, got: XidImpl [FormatId=257, GlobalId=108868d//5, BranchQual=1]
                            at org.jboss.resource.connectionmanager.LocalTxConnectionManager$LocalConnectionEventListener.rollback(LocalTxConnectionManager.java:640)
                            at org.jboss.tm.TxCapsule.rollbackResources(TxCapsule.java:1779)
                            at org.jboss.tm.TxCapsule.rollback(TxCapsule.java:475)
                            at org.jboss.tm.TransactionImpl.rollback(TransactionImpl.java:83)
                            at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:191)
                            at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60)
                            at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
                            at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:203)
                            at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
                            at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invoke(BaseLocalContainerInvoker.java:301)
                            at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:81)
                            at $Proxy14.processXML(Unknown Source)