4 Replies Latest reply on Sep 23, 2005 8:38 AM by Yan Hackl-Feldbusch

    hibernate + JTA error

    Emily Newbie

      Using jboss-4.0.0 with built-in hibernate:

      My app runs ok for awhile, but then crashes with this message:

      net.sf.hibernate.TransactionException: could not register synchronization with JTA TransactionManager
      ....

      11:38:08,353 INFO [STDOUT 140] Caused by: javax.transaction.RollbackException: Already marked for rollback TransactionImpl:XidImpl[FormatId=257, GlobalId=ESHORTXPDT/29, BranchQual=, localId=29]
      11:38:08,373 INFO [STDOUT 140] at org.jboss.tm.TransactionImpl.registerSynchronization(TransactionImpl.java:602)
      11:38:08,373 INFO [STDOUT 140] at net.sf.hibernate.impl.SessionImpl.connect(SessionImpl.java:3315)
      11:38:08,383 INFO [STDOUT 140] ... 62 more

      However, there are absolutely no rollbacks being called (I am running a single mbean method that makes MANY hibernate read-only calls with no rollbacks). The method runs the same query over and over and closes the session after each.

      Any ideas why I might be getting this?

      Emily

        • 1. Re: hibernate + JTA error
          Bernard Patteeuw Newbie

          Did you happen to find the solution to this problem ? ... I 'm having it too. Working with Oracle 9.2... and jboss 3.2.5.

          A stacktracke like this:

          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.usermgt.ias.GifResourceServlet.doGet(GifResourceServlet.java:44)
          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 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:462)
          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: 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)
          ... 46 more
          10:22:28,296 ERROR [Engine] StandardWrapperValve[GifResource]: Servlet.service() for servlet GifResource threw exception
          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.usermgt.ias.GifResourceServlet.doGet(GifResourceServlet.java:44)
          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 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:462)
          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: 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)
          ... 46 more

          • 2. Re: hibernate + JTA error
            Charles Qian Newbie

            I have this problem as well. One reason is that the transation is marked for Roll-back and Hibernate session cannot use the same UserTransation.

            Another reason is time out. I have not found a solution. Could you guys help me on this issue?

            Thanks,

            SQ

            • 3. Re: hibernate + JTA error
              Yan Hackl-Feldbusch Newbie

              try

              false

              in deploy/transaction-service.xml

              • 4. Re: hibernate + JTA error
                Yan Hackl-Feldbusch Newbie

                meaning

                <attribute name="Debug">false</attribute>