1 2 Previous Next 22 Replies Latest reply on Jul 5, 2013 4:22 AM by Suraj Tamang

    ARJUNA016051: thread is already associated with a transaction!

    Suraj Tamang Newbie

      Hi All,

       

      I am really having trouble with this transaction ARJUNA016051 in production server. Please help. I am using the JBoss AS 7.1.0.Final with PostgreSQL DB 9.1 and EJB3.1 and Prime Faces and JPA with Hibernate.

       

      javax.transaction.NotSupportedException: BaseTransaction.checkTransactionState - ARJUNA016051: thread is already associated with a transaction!

      com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.begin(BaseTransaction.java:63)

      com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.begin(BaseTransactionManagerDelegate.java:65)

      org.jboss.tm.usertx.client.ServerVMClientUserTransaction.begin(ServerVMClientUserTransaction.java:142)

      org.jboss.seam.transaction.UTTransaction.begin(UTTransaction.java:51)

      org.jboss.seam.transaction.DefaultSeamTransaction.begin(DefaultSeamTransaction.java:88)

      org.jboss.seam.transaction.TransactionServletListener.requestInitialized(TransactionServletListener.java:110)

      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)

      org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)

      org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)

      org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)

      java.lang.Thread.run(Thread.java:662)

       

      Please help on this issue.

        • 1. Re: ARJUNA016051: thread is already associated with a transaction!
          Nicklas Karlsson Master

          There is also a mention of Seam in the trace. What version?

          • 2. Re: ARJUNA016051: thread is already associated with a transaction!
            Suraj Tamang Newbie

            Thanks for your reply.

             

            In the application pom.xml. I have this dependency for seam:

             

            <!-- Seam Dependency -->

                    <dependency>

                        <groupId>org.jboss.seam.faces</groupId>

                        <artifactId>seam-faces</artifactId>

                        <version>3.1.0.Final</version>

                        <scope>runtime</scope>

                    </dependency>

             

                    <dependency>

                        <groupId>org.jboss.seam.faces</groupId>

                        <artifactId>seam-faces-api</artifactId>

                        <version>3.1.0.Final</version>

                    </dependency>

             

                    <dependency>

                        <groupId>org.jboss.seam.security</groupId>

                        <artifactId>seam-security-api</artifactId>

                        <version>3.1.0.Final</version>

                    </dependency>

             

                    <dependency>

                        <groupId>org.jboss.seam.security</groupId>

                        <artifactId>seam-security</artifactId>

                        <version>3.1.0.Final</version>

                        <scope>runtime</scope>

                    </dependency>

             

                    <dependency>

                        <groupId>org.jboss.seam.international</groupId>

                        <artifactId>seam-international</artifactId>

                        <version>3.1.0.Final</version>

                    </dependency>

             

            I am getting the HTTP 500 Internal Server Error too for transaction ARJUNA016051 in production server. Please help.

            • 3. Re: ARJUNA016051: thread is already associated with a transaction!
              Nicklas Karlsson Master

              How did it get into production without passing through a test server!?

               

              Have you tried upgrading seam to the latest version? Does this error always occur or only when some combination of EJB/CDI is used? Are you using @Inject or @PersistenceContext for EntityManager?

              • 4. Re: ARJUNA016051: thread is already associated with a transaction!
                Suraj Tamang Newbie

                Thanks for the quick reply.

                 

                Actually, in test UAT server its working very well, but I don't know why the application is throwing those errors or warnings.

                 

                We are using @PersistenceContext for Entity Manager.

                 

                No I don't think so we are using the proper EJB/CDI combination.

                 

                We are following the pattern provided by Adam Bien in his book. (Real World Java EE Patterns-Rethinking Best Practices -> DAO CrudService Interface)

                • 5. Re: ARJUNA016051: thread is already associated with a transaction!
                  Nicklas Karlsson Master

                  How does the test and production servers differ in setup?

                  • 6. Re: ARJUNA016051: thread is already associated with a transaction!
                    Suraj Tamang Newbie

                    In test server, the database and application server is in single machine where as in production we are using different machine for database and application server but they are in same LAN.

                     

                    Actually, we are using standalone-full.xml and they both seems be almost same except some parameters like IP address, etc. I have also used  JMS Hornet queues for sending email messages asynchornously but due to some error I have to revert back and have to use the @Asynchronous annotations for sending emails in EJB like:

                     

                    @Stateless

                    @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)

                    public class EmailSender {

                        

                         @Asynchronous

                        public void sendMail(Email email) {.....}

                    }

                     

                    This is my actual CrudServiceBean and its based on CMT.

                     

                    @Stateless

                    @Local(CrudService.class)

                    @TransactionAttribute(TransactionAttributeType.MANDATORY)

                    public class CrudServiceBean implements CrudService {

                       

                        @PersistenceContext(name = "PC_EM")

                        EntityManager em;

                     

                        private static final Logger logger = Logger.getLogger(CrudServiceBean.class.getName());

                     

                        public EntityManager getEntityManager() {

                            return this.em;

                        }

                     

                        @TransactionAttribute(TransactionAttributeType.MANDATORY)

                        public <T> T create(T t) throws SecurityException {

                            this.em.persist(t);

                            this.em.flush();

                            this.em.refresh(t);

                            return t;

                        }

                     

                        @TransactionAttribute(TransactionAttributeType.MANDATORY)

                        public <T> T update(T t) {

                            T upT = this.em.merge(t);

                            this.em.flush();

                            return (T) upT;

                        }

                     

                        @TransactionAttribute(TransactionAttributeType.MANDATORY)

                        public boolean delete(Object t) {

                            AbstractDomain a = (AbstractDomain) t;

                            a.setActive(false);

                            this.update(t);

                            return true;

                        }

                     

                        public <T> T find(Object id, Class<T> type) {

                            if (id == null)

                                return null;

                            return (T) this.em.find(type, id);

                        }

                     

                        @SuppressWarnings("unchecked")

                        @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)

                        public <T> T find(String queryName, Map<String, Object> parameters) {

                            List<T> list = findAll(queryName, parameters);

                            if (list.size() > 0)

                                return list.get(0);

                            return null;

                     

                        }

                     

                        @SuppressWarnings("rawtypes")

                        @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)

                        public List findAll(String queryName) {

                            return this.em.createNamedQuery(queryName).getResultList();

                        }

                     

                        @SuppressWarnings("rawtypes")

                        @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)

                        public List findAll(String namedQueryName, Map<String, Object> parameters) {

                            return findWithRowLimit(namedQueryName, parameters, 0);

                        }

                     

                        @SuppressWarnings("rawtypes")

                        @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)

                        public List findWithRowLimit(String queryName, int resultLimit) {

                            return this.em.createNamedQuery(queryName).setMaxResults(resultLimit).getResultList();

                        }

                     

                        @SuppressWarnings("rawtypes")

                        @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)

                        public List findWithRowLimit(String namedQueryName, Map<String, Object> parameters, int resultLimit) {

                            try {

                                Set<Entry<String, Object>> rawParameters = parameters.entrySet();

                                Query query = this.em.createNamedQuery(namedQueryName);

                                if(resultLimit > 0)

                                    query.setMaxResults(resultLimit);

                                for(Entry<String, Object> entry : rawParameters)

                                    query.setParameter(entry.getKey(), entry.getValue());           

                                return query.getResultList();

                            } catch (Exception e) {

                                logger.info("MESSAGE: " + e.getMessage());

                                logger.log(Level.SEVERE, "Error while finding..");

                                return Collections.EMPTY_LIST;

                            }

                        }

                     

                    I think this might help you to find answers. Thanks for your reply again.

                    • 7. Re: ARJUNA016051: thread is already associated with a transaction!
                      Scott Marlow Master

                      You should enable TRACE logging and correlate what that shows, with your application code.  Here are some instructions for enabling TRACE logging.   You  probably want to enable TRACE for org.jboss.as.jpa and com.arjuna.  That will show you the operations performed on the transaction manager and the container managed EntityManager.

                       

                      From that you can figure out exactly what is going on in your application with regard to the error and whether you can make a change to avoid the error (once you understand why its happening).

                       

                      Scott

                      • 8. Re: ARJUNA016051: thread is already associated with a transaction!
                        Suraj Tamang Newbie

                        Thanks for the reply.

                         

                        Ok I will add TRACE logging for org.jboss.as.jpa. Thanks.

                        • 9. Re: ARJUNA016051: thread is already associated with a transaction!
                          Suraj Tamang Newbie

                          Hi Everyone,

                           

                          I have enabled the TRACE logging. Now, I have the following Error:

                           

                          17:09:13,233 TRACE [org.jboss.as.jpa] (http--0.0.0.0-8443-15) createNamedQuery name 'com.company.domain.User.FIND_BY_USER_NAME' took 0ms

                          17:09:13,243 DEBUG [org.jboss.as.jpa] (http--0.0.0.0-8443-15) http--0.0.0.0-8443-15:[transaction scoped EntityManager]: created entity manager session TransactionImple < ac, BasicAction: 0:ffff0a110115:7505a415:51362405:7e2cb status: ActionStatus.RUNNING >

                          17:09:13,251 TRACE [org.jboss.as.jpa] (http--0.0.0.0-8443-15) merge entityClass 'com.company.domain.User' took 8ms

                          17:09:13,253 DEBUG [org.jboss.as.jpa] (http--0.0.0.0-8443-15) http--0.0.0.0-8443-15:[transaction scoped EntityManager]: reuse entity manager session already in tx TransactionImple < ac, BasicAction: 0:ffff0a110115:7505a415:51362405:7e2cb status: ActionStatus.RUNNING >

                          17:09:13,260 TRACE [org.jboss.as.jpa] (http--0.0.0.0-8443-15) flush took 7ms

                          17:09:13,262 DEBUG [org.jboss.as.jpa] (http--0.0.0.0-8443-15) http--0.0.0.0-8443-15:[transaction scoped EntityManager]: closing entity managersession

                          17:09:14,507 WARN  [org.jboss.seam.transaction.TransactionServletListener] (http--0.0.0.0-8443-4) Error starting the transaction: javax.transaction.NotSupportedException: BaseTransaction.checkTransactionState - ARJUNA016051: thread is already associated with a transaction!

                              at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.begin(BaseTransaction.java:63)

                              at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.begin(BaseTransactionManagerDelegate.java:65)

                              at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.begin(ServerVMClientUserTransaction.java:142)

                              at org.jboss.seam.transaction.UTTransaction.begin(UTTransaction.java:51) [seam-transaction-3.1.0.Final.jar:3.1.0.Final]

                              at org.jboss.seam.transaction.DefaultSeamTransaction.begin(DefaultSeamTransaction.java:88) [seam-transaction-3.1.0.Final.jar:3.1.0.Final]

                              at org.jboss.seam.transaction.TransactionServletListener.requestInitialized(TransactionServletListener.java:110) [seam-transaction-3.1.0.Final.jar:3.1.0.Final]

                              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143) [jbossweb-7.0.10.Final.jar:]

                              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.10.Final.jar:]

                              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.10.Final.jar:]

                              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.10.Final.jar:]

                              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.10.Final.jar:]

                              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.10.Final.jar:]

                              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.10.Final.jar:]

                              at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_39]

                          Caused by: java.lang.IllegalStateException: BaseTransaction.checkTransactionState - ARJUNA016051: thread is already associated with a transaction!

                              at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.checkTransactionState(BaseTransaction.java:257)

                              at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.begin(BaseTransaction.java:59)

                              ... 13 more

                           

                           

                          Please help us in this matter. I have not idea why it is throwing the ARJUNA016051: thread is already associated with a transaction!

                           

                          As mentioned I have used Container Managed Transactions.

                           

                          Thanks.

                          • 10. Re: ARJUNA016051: thread is already associated with a transaction!
                            Wolf-Dieter Fink Master

                            The log excerpt shows different threads.

                            From my understanding Seam try to start a transaction where the thread has already a running Tx. (I'm not familiar with seam so I can't help here)

                             

                            but from the log you need to go back along the thread (http--0.0.0.0-8443-4) and find where it starts, open the first Tx and run into that issue.

                            • 11. Re: ARJUNA016051: thread is already associated with a transaction!
                              Suraj Tamang Newbie

                              After going through the log I found out that I have done two updates in two different entities. Using following methods.

                               

                              @TransactionAttribute(TransactionAttributeType.MANDATORY)

                                  public <T> T update(T t) {

                                      T upT = this.em.merge(t);

                                      this.em.flush();

                                      return (T) upT;

                                  }

                               

                              20:36:12,101 DEBUG [org.jboss.as.jpa] (http-0.0.0.0-0.0.0.0-8443-16) http-0.0.0.0-0.0.0.0-8443-16:[transaction scoped EntityManager]: created entity manager session TransactionImple < ac, BasicAction: 0:ffff0a110115:-71cb52dc:51494d22:7fa7 status: ActionStatus.RUNNING >

                              20:36:12,105 TRACE [org.jboss.as.jpa] (http-0.0.0.0-0.0.0.0-8443-16) merge entityClass 'com.company.DomainClass' took 4ms

                              20:36:12,105 DEBUG [org.jboss.as.jpa] (http-0.0.0.0-0.0.0.0-8443-16) http-0.0.0.0-0.0.0.0-8443-16:[transaction scoped EntityManager]: reuse entity manager session already in tx TransactionImple < ac, BasicAction: 0:ffff0a110115:-71cb52dc:51494d22:7fa7 status: ActionStatus.RUNNING >

                              20:36:12,107 TRACE [org.jboss.as.jpa] (http-0.0.0.0-0.0.0.0-8443-16) flush took 2ms

                               

                              And After five mintues I got this one:

                               

                              20:41:12,091 WARN  [com.arjuna.ats.arjuna] (Transaction Reaper) ARJUNA012117: TransactionReaper::check timeout for TX 0:ffff0a110115:-71cb52dc:51494d22:7fa7 in state  RUN

                              20:41:12,097 DEBUG [org.jboss.as.jpa] (Transaction Reaper Worker 0) Transaction Reaper Worker 0:[transaction scoped EntityManager]: closing entity managersession

                              20:41:12,098 WARN  [com.arjuna.ats.arjuna] (Transaction Reaper Worker 0) ARJUNA012121: TransactionReaper::doCancellations worker Thread[Transaction Reaper Worker 0,5,main] successfully canceled TX 0:ffff0a110115:-71cb52dc:51494d22:7fa7

                               

                              Again After five minutes I got this one:

                               

                              20:51:43,749 WARN  [org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory] (http-0.0.0.0-0.0.0.0-8443-16) Destroying connection that is not valid, due to the following exception: org.postgresql.jdbc4.Jdbc4Connection@7d77749a: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.

                               

                              then after sometime I got this one:


                              21:05:00,002 WARN  [com.arjuna.ats.arjuna] (Transaction Reaper) ARJUNA012117: TransactionReaper::check timeout for TX 0:ffff0a110115:-71cb52dc:51494d22:80b0 in state  RUN

                              21:05:00,006 WARN  [com.arjuna.ats.arjuna] (Transaction Reaper) ARJUNA012117: TransactionReaper::check timeout for TX 0:ffff0a110115:-71cb52dc:51494d22:80b4 in state  RUN

                              21:05:00,008 WARN  [com.arjuna.ats.jta] (Transaction Reaper Worker 0) ARJUNA016045: attempted rollback of < formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffff0a110115:-71cb52dc:51494d22:80b0, node_name=1, branch_uid=0:ffff0a110115:-71cb52dc:51494d22:80b1, subordinatenodename=null, eis_name=unknown eis name > (org.jboss.ejb.client.EJBClientManagedTransactionContext$ResourceImpl@66412457) failed with exception code -: java.lang.IllegalStateException: No EJB client context is available

                                  at org.jboss.ejb.client.EJBClientContext.requireCurrent(EJBClientContext.java:233)

                                  at org.jboss.ejb.client.EJBClientManagedTransactionContext$ResourceImpl.rollback(EJBClientManagedTransactionContext.java:234)

                                  at com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord.topLevelAbort(XAResourceRecord.java:345) [jbossjts-4.16.2.Final.jar:]

                                  at com.arjuna.ats.arjuna.coordinator.BasicAction.doAbort(BasicAction.java:2874) [jbossjts-4.16.2.Final.jar:]

                                  at com.arjuna.ats.arjuna.coordinator.BasicAction.doAbort(BasicAction.java:2853) [jbossjts-4.16.2.Final.jar:]

                                  at com.arjuna.ats.arjuna.coordinator.BasicAction.Abort(BasicAction.java:1616) [jbossjts-4.16.2.Final.jar:]

                                  at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.cancel(TwoPhaseCoordinator.java:118) [jbossjts-4.16.2.Final.jar:]

                                  at com.arjuna.ats.arjuna.AtomicAction.cancel(AtomicAction.java:217) [jbossjts-4.16.2.Final.jar:]

                                  at com.arjuna.ats.arjuna.coordinator.TransactionReaper.doCancellations(TransactionReaper.java:370) [jbossjts-4.16.2.Final.jar:]

                                  at com.arjuna.ats.internal.arjuna.coordinator.ReaperWorkerThread.run(ReaperWorkerThread.java:78) [jbossjts-4.16.2.Final.jar:]

                               

                              Again,

                               

                              21:15:30,804 WARN  [org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory] (EJB default - 6) Destroying connection that is not valid, due to the following exception: org.postgresql.jdbc4.Jdbc4Connection@4cf10527: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.

                               

                              Again,

                               

                              21:35:00,002 WARN  [com.arjuna.ats.arjuna] (Transaction Reaper) ARJUNA012117: TransactionReaper::check timeout for TX 0:ffff0a110115:-71cb52dc:51494d22:842a in state  RUN

                              21:35:00,006 WARN  [com.arjuna.ats.arjuna] (Transaction Reaper) ARJUNA012117: TransactionReaper::check timeout for TX 0:ffff0a110115:-71cb52dc:51494d22:842e in state  RUN

                              21:35:00,006 WARN  [com.arjuna.ats.jta] (Transaction Reaper Worker 0) ARJUNA016045: attempted rollback of < formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffff0a110115:-71cb52dc:51494d22:842a, node_name=1, branch_uid=0:ffff0a110115:-71cb52dc:51494d22:842b, subordinatenodename=null, eis_name=unknown eis name > (org.jboss.ejb.client.EJBClientManagedTransactionContext$ResourceImpl@1f242916) failed with exception code -: java.lang.IllegalStateException: No EJB client context is available

                                  at org.jboss.ejb.client.EJBClientContext.requireCurrent(EJBClientContext.java:233)

                                  at org.jboss.ejb.client.EJBClientManagedTransactionContext$ResourceImpl.rollback(EJBClientManagedTransactionContext.java:234)

                                  at com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord.topLevelAbort(XAResourceRecord.java:345) [jbossjts-4.16.2.Final.jar:]

                                  at com.arjuna.ats.arjuna.coordinator.BasicAction.doAbort(BasicAction.java:2874) [jbossjts-4.16.2.Final.jar:]

                                  at com.arjuna.ats.arjuna.coordinator.BasicAction.doAbort(BasicAction.java:2853) [jbossjts-4.16.2.Final.jar:]

                                  at com.arjuna.ats.arjuna.coordinator.BasicAction.Abort(BasicAction.java:1616) [jbossjts-4.16.2.Final.jar:]

                                  at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.cancel(TwoPhaseCoordinator.java:118) [jbossjts-4.16.2.Final.jar:]

                                  at com.arjuna.ats.arjuna.AtomicAction.cancel(AtomicAction.java:217) [jbossjts-4.16.2.Final.jar:]

                                  at com.arjuna.ats.arjuna.coordinator.TransactionReaper.doCancellations(TransactionReaper.java:370) [jbossjts-4.16.2.Final.jar:]

                                  at com.arjuna.ats.internal.arjuna.coordinator.ReaperWorkerThread.run(ReaperWorkerThread.java:78) [jbossjts-4.16.2.Final.jar:]

                               

                              Again,

                               

                              21:45:30,995 WARN  [org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory] (EJB default - 1) Destroying connection that is not valid, due to the following exception: org.postgresql.jdbc4.Jdbc4Connection@691820b4: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.

                               

                              Again,

                               

                              22:02:55,131 WARN  [com.arjuna.ats.arjuna] (Transaction Reaper) ARJUNA012117: TransactionReaper::check timeout for TX 0:ffff0a110115:-71cb52dc:51494d22:8684 in state  RUN

                              22:02:55,170 WARN  [com.arjuna.ats.arjuna] (Transaction Reaper) ARJUNA012117: TransactionReaper::check timeout for TX 0:ffff0a110115:-71cb52dc:51494d22:8688 in state  RUN

                              22:02:55,170 WARN  [com.arjuna.ats.jta] (Transaction Reaper Worker 0) ARJUNA016045: attempted rollback of < formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffff0a110115:-71cb52dc:51494d22:8684, node_name=1, branch_uid=0:ffff0a110115:-71cb52dc:51494d22:8685, subordinatenodename=null, eis_name=unknown eis name > (org.jboss.ejb.client.EJBClientManagedTransactionContext$ResourceImpl@340ed5) failed with exception code -: java.lang.IllegalStateException: No EJB client context is available

                                  at org.jboss.ejb.client.EJBClientContext.requireCurrent(EJBClientContext.java:233)

                                  at org.jboss.ejb.client.EJBClientManagedTransactionContext$ResourceImpl.rollback(EJBClientManagedTransactionContext.java:234)

                                  at com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord.topLevelAbort(XAResourceRecord.java:345) [jbossjts-4.16.2.Final.jar:]

                                  at com.arjuna.ats.arjuna.coordinator.BasicAction.doAbort(BasicAction.java:2874) [jbossjts-4.16.2.Final.jar:]

                                  at com.arjuna.ats.arjuna.coordinator.BasicAction.doAbort(BasicAction.java:2853) [jbossjts-4.16.2.Final.jar:]

                                  at com.arjuna.ats.arjuna.coordinator.BasicAction.Abort(BasicAction.java:1616) [jbossjts-4.16.2.Final.jar:]

                                  at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.cancel(TwoPhaseCoordinator.java:118) [jbossjts-4.16.2.Final.jar:]

                                  at com.arjuna.ats.arjuna.AtomicAction.cancel(AtomicAction.java:217) [jbossjts-4.16.2.Final.jar:]

                                  at com.arjuna.ats.arjuna.coordinator.TransactionReaper.doCancellations(TransactionReaper.java:370) [jbossjts-4.16.2.Final.jar:]

                                  at com.arjuna.ats.internal.arjuna.coordinator.ReaperWorkerThread.run(ReaperWorkerThread.java:78) [jbossjts-4.16.2.Final.jar:]

                              22:02:55,199 WARN  [com.arjuna.ats.arjuna] (Transaction Reaper Worker 0) ARJUNA012091: Top-level abort of action 0:ffff0a110115:-71cb52dc:51494d22:8684 received TwoPhaseOutcome.FINISH_ERROR from com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord

                              22:02:55,203 WARN  [com.arjuna.ats.arjuna] (Transaction Reaper Worker 0) ARJUNA012121: TransactionReaper::doCancellations worker Thread[Transaction Reaper Worker 0,5,main] successfully canceled TX 0:ffff0a110115:-71cb52dc:51494d22:8684

                              22:02:55,207 WARN  [com.arjuna.ats.arjuna] (Transaction Reaper Worker 0) ARJUNA012121: TransactionReaper::doCancellations worker Thread[Transaction Reaper Worker 0,5,main] successfully canceled TX 0:ffff0a110115:-71cb52dc:51494d22:8688

                               

                              Again,


                              22:13:26,260 WARN  [org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory] (http-0.0.0.0-0.0.0.0-8443-16) Destroying connection that is not valid, due to the following exception: org.postgresql.jdbc4.Jdbc4Connection@3188403c: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.

                               

                              Again,

                               

                              22:18:30,165 WARN  [com.arjuna.ats.arjuna] (Transaction Reaper) ARJUNA012117: TransactionReaper::check timeout for TX 0:ffff0a110115:-71cb52dc:51494d22:88a0 in state  RUN

                              22:18:30,167 INFO  [stdout] (http-0.0.0.0-0.0.0.0-8443-19) User not register

                              22:18:30,173 WARN  [com.arjuna.ats.arjuna] (Transaction Reaper Worker 0) ARJUNA012095: Abort of action id 0:ffff0a110115:-71cb52dc:51494d22:88a0 invoked while multiple threads active within it.

                              22:18:30,175 INFO  [stdout] (http-0.0.0.0-0.0.0.0-8443-19) Value = true

                              22:18:30,178 WARN  [com.arjuna.ats.arjuna] (Transaction Reaper Worker 0) ARJUNA012108: CheckedAction::check - atomic action 0:ffff0a110115:-71cb52dc:51494d22:88a0 aborting with 1 threads active!

                              22:18:30,185 WARN  [com.arjuna.ats.jta] (Transaction Reaper Worker 0) ARJUNA016045: attempted rollback of < formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffff0a110115:-71cb52dc:51494d22:88a0, node_name=1, branch_uid=0:ffff0a110115:-71cb52dc:51494d22:88a1, subordinatenodename=null, eis_name=unknown eis name > (org.jboss.ejb.client.EJBClientManagedTransactionContext$ResourceImpl@1600a05f) failed with exception code -: java.lang.IllegalStateException: No EJB client context is available

                                  at org.jboss.ejb.client.EJBClientContext.requireCurrent(EJBClientContext.java:233)

                                  at org.jboss.ejb.client.EJBClientManagedTransactionContext$ResourceImpl.rollback(EJBClientManagedTransactionContext.java:234)

                                  at com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord.topLevelAbort(XAResourceRecord.java:345) [jbossjts-4.16.2.Final.jar:]

                                  at com.arjuna.ats.arjuna.coordinator.BasicAction.doAbort(BasicAction.java:2874) [jbossjts-4.16.2.Final.jar:]

                                  at com.arjuna.ats.arjuna.coordinator.BasicAction.doAbort(BasicAction.java:2853) [jbossjts-4.16.2.Final.jar:]

                                  at com.arjuna.ats.arjuna.coordinator.BasicAction.Abort(BasicAction.java:1616) [jbossjts-4.16.2.Final.jar:]

                                  at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.cancel(TwoPhaseCoordinator.java:118) [jbossjts-4.16.2.Final.jar:]

                                  at com.arjuna.ats.arjuna.AtomicAction.cancel(AtomicAction.java:217) [jbossjts-4.16.2.Final.jar:]

                                  at com.arjuna.ats.arjuna.coordinator.TransactionReaper.doCancellations(TransactionReaper.java:370) [jbossjts-4.16.2.Final.jar:]

                                  at com.arjuna.ats.internal.arjuna.coordinator.ReaperWorkerThread.run(ReaperWorkerThread.java:78) [jbossjts-4.16.2.Final.jar:]

                               

                              22:18:30,212 WARN  [com.arjuna.ats.arjuna] (Transaction Reaper Worker 0) ARJUNA012091: Top-level abort of action 0:ffff0a110115:-71cb52dc:51494d22:88a0 received TwoPhaseOutcome.FINISH_ERROR from com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord

                              22:18:30,217 WARN  [com.arjuna.ats.arjuna] (Transaction Reaper Worker 0) ARJUNA012121: TransactionReaper::doCancellations worker Thread[Transaction Reaper Worker 0,5,main] successfully canceled TX 0:ffff0a110115:-71cb52dc:51494d22:88a0

                               

                              After that I got the different Exception:

                               

                              22:29:05,270 INFO  [javax.enterprise.resource.webcontainer.jsf.context] (http-0.0.0.0-0.0.0.0-8443-16) Exception when handling error trying to reset the response.: java.lang.IllegalStateException: Cannot create a session after the response has been committed

                               

                              And finally I got this one(ARJUNA016051):

                               

                              22:51:19,237 WARN  [org.jboss.seam.transaction.TransactionServletListener] (http-0.0.0.0-0.0.0.0-8443-16) Error starting the transaction: javax.transaction.NotSupportedException: BaseTransaction.checkTransactionState - ARJUNA016051: thread is already associated with a transaction!

                               

                              After that the application is frequently getting this ARJUNA016051: thread is already associated with a transaction!.

                               

                              So, any help regarding this matter? Thanks.

                              • 12. Re: ARJUNA016051: thread is already associated with a transaction!
                                Mark Paluch Master

                                Have you tried to omit (for testing purposes) all this TX-Annotations (and reducing the stuff you're performing while the calls)? Looks like your transaction is not committed propertly.

                                • 13. Re: ARJUNA016051: thread is already associated with a transaction!
                                  Scott Marlow Master

                                  The likely cause for "ARJUNA012117: TransactionReaper::check timeout for TX", is that you are experiencing a resource deadlock.  You could take thread dumps before the five minutes is up (hack together a script if needed to get AS thread dumps every minute if you like).   You might also look at what is locked on the db server around this time as well (could also be a distributed deadlock that includes java side locks and db server side locks.)  Fun stuff to hunt down.  If you have EAP support with Red Hat, ask for help/guidance through correcting this. 

                                   

                                  My guess is that you are probably suspending transactions that have locks already and the new transactions need to lock the same database row(s).

                                   

                                  For the original error, also enable TRACE logging on com.arjuna, I think that will show some basic transactional operations (like tx start/end/suspend/resume).  Having the Transactional operations and the JPA operations together, will be more useful.  You probably could attach your server.log (zipped) from the point of the tx begin, to a bit after the error. 

                                  • 14. Re: ARJUNA016051: thread is already associated with a transaction!
                                    Suraj Tamang Newbie

                                    Thanks for the reply everyone.

                                     

                                    I have enabled the TRACE logging on com.arjuna.jts part. Again, I couldn't figure out the ARJUNA Transaction part.

                                     

                                    Please help on this. I have found transaction reaper timeout, but couldn't figure out any clue on regarding ARJUNA016051.

                                     

                                    http://pastebin.com/rk2UKJ1n

                                     

                                    I have added the log in above give URL.

                                     

                                    Thank you all for your support.

                                     

                                    Extra Information:

                                     

                                    Connection Pool Info and others:

                                    <pool>

                                         <min-pool-size>2</min-pool-size>

                                         <max-pool-size>30</max-pool-size>

                                         <prefill>true</prefill>

                                    </pool>

                                    <validation>

                                         <check-valid-connection-sql>SELECT 1</check-valid-connection-sql>

                                    </validation>

                                    <timeout>

                                         <idle-timeout-minutes>5</idle-timeout-minutes>

                                    </timeout>

                                    <statement>

                                         <track-statements>TRUE</track-statements>

                                    </statement>

                                     

                                    Drivers:

                                    <drivers>
                                         <driver name="postgresql" module="org.postgresql">

                                              <xa-datasource-class>org.postgresql.Driver</xa-datasource-class>

                                         </driver>

                                    </drivers>

                                     

                                    EJB:

                                        <subsystem xmlns="urn:jboss:domain:ejb3:1.2">
                                            <session-bean>
                                                <stateless>
                                                    <bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>
                                                </stateless>
                                                <stateful default-access-timeout="5000" cache-ref="simple"/>
                                                <singleton default-access-timeout="5000"/>
                                            </session-bean>
                                            <mdb>
                                                <resource-adapter-ref resource-adapter-name="hornetq-ra"/>
                                                <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
                                            </mdb>
                                            <pools>
                                                <bean-instance-pools>
                                                    <strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
                                                    <strict-max-pool name="mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
                                                </bean-instance-pools>
                                            </pools>
                                            <caches>
                                                <cache name="simple" aliases="NoPassivationCache"/>
                                                <cache name="passivating" passivation-store-ref="file" aliases="SimpleStatefulCache"/>
                                            </caches>
                                            <passivation-stores>
                                                <file-passivation-store name="file"/>
                                            </passivation-stores>
                                            <async thread-pool-name="default"/>
                                            <timer-service thread-pool-name="default">
                                                <data-store path="timer-service-data" relative-to="jboss.server.data.dir"/>
                                            </timer-service>
                                            <remote connector-ref="remoting-connector" thread-pool-name="default"/>
                                            <thread-pools>
                                                <thread-pool name="default">
                                                    <max-threads count="10"/>
                                                    <keepalive-time time="100" unit="milliseconds"/>
                                                </thread-pool>
                                            </thread-pools>
                                            <iiop enable-by-default="false" use-qualified-name="false"/>
                                        </subsystem>
                                    1 2 Previous Next