5 Replies Latest reply on Jun 14, 2008 11:42 AM by jaikiran

    Transaction not active exception

    green804

      Hi,

      I'm new to using EJB3 and RMI. I am using annotations. We recently launched our application in production, and the user login and registration is hanging. We did not see these issues in dev or testing. We have a tomcat app that talks to the JBoss app using RMI. We are using Jboss clustered in production.

      I'm hoping someone can help answer the following:
      1. What might be causing an error like this? What does the error mean?
      2. Could the JBoss clustering be the source of this problem? I saw something about adding @cluster to the bean. Do I need this?
      3. Is there a configuration in JBoss that we need to set to fix this problem?

      I've included the stack trace below.

      [ERROR] [2008-06-13 00:18:59,567] Servlet.service() for servlet ULRServlet threw exception
      java.lang.IllegalStateException: [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] The transaction is not active!
      at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1372)
      at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135)
      at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87)
      at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:175)
      at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)
      at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
      at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:278)
      at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
      at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
      at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:734)
      at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:560)
      at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:383)
      at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:165)
      at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:163)
      at org.jboss.remoting.Client.invoke(Client.java:1550)
      at org.jboss.remoting.Client.invoke(Client.java:530)
      at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:62)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:72)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:103)
      at $Proxy96.getUserData(Unknown Source)

      I would appreciate any help on this. I'm trying to go on vacation, but I need this issue resolved. :)

        • 1. Re: Transaction not active exception
          jaikiran

          Which version of JBoss and Java do you use? And do you see any other exceptions in the logs?

          • 2. Re: Transaction not active exception
            jaikiran

            And the getUserData method on your bean, what transaction attribute does it have? How long does this method take to complete? Maybe the transaction is timing out before this method completes? Have you changed and transaction timeout values anywhere (like in the jboss-service.xml)?

            • 3. Re: Transaction not active exception
              green804

              We are using Jboss 4.2.1.GA and Java 1.5. There are no other exceptions in the logs. Just this same error over and over.

              This method is running a select against the DB. It takes about .15 seconds to complete. I'm checking the the transaction timeout value with the sys admin.

              I do not have a transaction attribute on the moethod. Late last night I began to suspect this might be the problem. I do not need transctions for this method. It's a select. Do you have any examples of how to set the transaction attribute? Can I do it using annotations?

              Thanks in advance for your help.

              • 4. Re: Transaction not active exception
                green804

                One more question. If I was to need a transaction for an update of user data, what should I set the transaction attribute to?

                • 5. Re: Transaction not active exception
                  jaikiran

                   

                  "green804" wrote:

                  This method is running a select against the DB. It takes about .15 seconds to complete. I'm checking the the transaction timeout value with the sys admin.


                  The default transaction timeout is 5 minutes (=300 seconds) and is set in the jboss-service.xml in %JBOSS_HOME%\server\< serverName>\conf folder.

                  "green804" wrote:

                  I do not have a transaction attribute on the moethod.


                  So, by default, the transaction attribute of that method will be REQUIRED.

                  "green804" wrote:

                  I do not need transctions for this method. It's a select. Do you have any examples of how to set the transaction attribute? Can I do it using annotations?


                  Yes, you can set the transaction attribute on that method using annotations. If you don't need transaction on that method, you can set it as follows:
                  @TransactionAttribute(TransactionAttributeType.SUPPORTS)
                  public ... getUserData(...) {


                  See this http://docs.sun.com/app/docs/doc/819-3669/6n5sg7cm3?a=view for the available transaction attribute types and their meaning.

                  "green804" wrote:

                  If I was to need a transaction for an update of user data, what should I set the transaction attribute to?


                  REQUIRED should work. See that link that i mentioned above. That should help you in deciding the correct transaction attribute type.