2 Replies Latest reply on Jun 18, 2006 10:14 PM by vickyk

    Wrong transaction association

    jbossacm

      I'm having trouble with transactions in JBOSS 4.0

      I have the following code to create my transaction within a Sateless Session Bean:

      UserTransaction transaction;
      transaction = (UserTransaction) ctx.lookup("UserTransaction");
      transaction.begin();
      


      It seems as though when the begin statement is called, I get the following error:

      java.lang.IllegalStateException: Wrong transaction association: expected TransactionImpl:XidImpl[FormatId=257, GlobalId=DELL001/32, BranchQual=, localId=32] was null
       at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:442)
       at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:325)
       at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:149)
       at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:128)
       at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
       at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
       at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
       at org.jboss.ejb.Container.invoke(Container.java:854)
       at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:413)
       at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:82)
      


      Can anybody tell me what's going on? I can't seem to find any information in any forum.

      Thanks so much.

        • 1. Re: Wrong transaction association
          jbossacm

          OK, it seems I found out what was wrong.

          I'm using CMT and I was trying to obtain an explicit transaction inside a Stateless Session Bean.

          The thing is that I'm performing a migration from Weblogic to Jboss and in Weblogic I needed to obtain this transaction explcitily, if not, it did not work. Whereas in Jboss it seems to violate the EJB specification.

          Now that I have eliminated the explicit user transaction, it works like a charm. The downside is that the code will not be portable.

          If anybody has more insight on the subject please feel free to post.

          Thanks!

          • 2. Re: Wrong transaction association
            vickyk

             


            The thing is that I'm performing a migration from Weblogic to Jboss and in Weblogic I needed to obtain this transaction explcitily, if not, it did not work. Whereas in Jboss it seems to violate the EJB specification.

            I dont understand if you were using the CMT why would you explicitity get the UserTransaction Object in the SesionBean then . Can you please confirm this ?

            Regards
            Vicky