6 Replies Latest reply on Nov 22, 2004 7:17 PM by Adrian Brock

    Help with error from my log file

    rfn Newbie

      I'm getting this exception:

      sactionException: could not register synchronization with JTA TransactionManager
      at org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:545)
      at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:486)
      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
      at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)


      How do I debug this???

        • 1. Re: Help with error from my log file
          Adrian Brock Master

          Post the real/full exception rather than just the message.
          Most likely you don't have a transaction or it was already marked for rollback.

          Regards,
          Adrian

          • 2. Re: Help with error from my log file
            pdg Newbie

            We have the same problem (using Hibernate / Oracle 9.2)...
            Did you find a solution ?

            • 3. Re: Help with error from my log file
              pdg Newbie

              I have the following stack trace:

              davinci.SystemException: net.sf.hibernate.TransactionException: could not register synchronization with JTA TransactionManager
              at davinci.flowmgt.ProcessManagerBean.getProcessInstance(ProcessManagerBean.java:1690)
              at davinci.flowmgt.ProcessManagerBean.getProcessInstance(ProcessManagerBean.java:456)
              at sun.reflect.GeneratedMethodAccessor591.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:324)
              at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
              at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
              at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
              at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
              at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:315)
              at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:148)
              at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:120)
              at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
              at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
              at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
              at org.jboss.ejb.Container.invoke(Container.java:723)
              at sun.reflect.GeneratedMethodAccessor186.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:324)
              at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
              at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
              at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
              at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
              at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
              at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
              at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:97)
              at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:90)
              at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
              at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:53)
              at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:100)
              at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
              at $Proxy47.getProcessInstance(Unknown Source)
              at davinci.flowmgt.web.LeonardoAction.handleSelectProcessRequest(LeonardoAction.java:263)
              at davinci.flowmgt.web.LeonardoAction.executeGet(LeonardoAction.java:139)
              at davinci.flowmgt.web.LeonardoAction.execute(LeonardoAction.java:100)
              at be.belgacom.webtracker.projectmgt.web.TrackerLeonardoAction.execute(TrackerLeonardoAction.java:129)
              at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
              at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
              at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
              at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
              at davinci.usermgt.ias.SecurityFilter.doFilter(SecurityFilter.java:172)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
              at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
              at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
              at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:72)
              at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
              at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:275)
              at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540)
              at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
              at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
              at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
              at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:444)
              at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
              at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
              at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
              at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
              at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
              at java.lang.Thread.run(Thread.java:536)
              Caused by: net.sf.hibernate.TransactionException: could not register synchronization with JTA TransactionManager
              at net.sf.hibernate.impl.SessionImpl.connect(SessionImpl.java:3282)
              at net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:3244)
              at net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.java:65)
              at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:704)
              at net.sf.hibernate.loader.Loader.doQuery(Loader.java:185)
              at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
              at net.sf.hibernate.loader.Loader.doList(Loader.java:950)
              at net.sf.hibernate.loader.Loader.list(Loader.java:941)
              at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:834)
              at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1512)
              at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
              at net.sf.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:527)
              at davinci.flowmgt.ProcessManagerBean.getProcessInstance(ProcessManagerBean.java:1684)
              ... 76 more
              Caused by: javax.transaction.RollbackException: Already marked for rollback
              at org.jboss.tm.TransactionImpl.registerSynchronization(TransactionImpl.java:704)
              at net.sf.hibernate.impl.SessionImpl.connect(SessionImpl.java:3277)
              ... 88 more

              • 4. Re: Help with error from my log file
                Adrian Brock Master

                Somebody has already marked for the transaction for rollback.

                You should be throwing exceptions all the way back to the transaction boundary,
                not catching exceptions and trying to continue.

                • 5. Re: Help with error from my log file
                  pdg Newbie

                  I agree, but:

                  1) I cannot reproduce it in my test environment. It only happens when the application is used by mutiple users and runs about a day (on the production machine, same db, versions etc...). (So if I did something wrong in the code, I would have this always, no?)

                  2) It sometimes happens in a servlet, where I just execute a simple select query; I never start there a transation/commit or someting like that...


                  However, I do the following thing:

                  ...
                  } catch(SomeException e) {
                   sessionContext.setRollbackOnly();
                   throw e;
                  }
                  


                  But if this is wrong, It must give always the problem, no ?




                  • 6. Re: Help with error from my log file
                    Adrian Brock Master

                    1) Your test environment is useless if you cannot use it to reproduce production loads/problems.
                    2) Something is catching the SomeException further up the stack then trying to do
                    more work. It should be allowing the transaction to rollback. Once that has happened,
                    you can retry the transaction.