3 Replies Latest reply on Oct 28, 2006 1:31 PM by Andy W. Clements

    java.lang.RuntimeException: org.jboss.tm.JBossRollbackExcep

    Andy W. Clements Newbie

      Hello Forum Folks,

      I have an EJB3 application running off of JBoss 4.0.4GA.

      I'm trying to call a bean from a servlet. At first I was getting these errors:

      11:11:29,362 ERROR [STDERR] javax.ejb.EJBException: java.lang.IllegalArgumentException: Wrong target. class com.clementsengineering.session.UserActionsBean for public int com.clementsengineering.session.UserActionsBean.scheduleFlight(int,com.clementsengineering.persistence.Users)
      11:11:29,362 ERROR [STDERR] at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
      11:11:29,362 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
      11:11:29,363 ERROR [STDERR] at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
      11:11:29,363 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      11:11:29,363 ERROR [STDERR] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
      11:11:29,363 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      11:11:29,363 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
      11:11:29,363 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      11:11:29,363 ERROR [STDERR] at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
      11:11:29,363 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      11:11:29,363 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
      11:11:29,364 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      11:11:29,364 ERROR [STDERR] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
      11:11:29,364 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      11:11:29,364 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:181)
      11:11:29,364 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:79)
      11:11:29,364 ERROR [STDERR] at $Proxy103.scheduleFlight(Unknown Source)
      11:11:29,364 ERROR [STDERR] at com.clementsengineering.servlet.TestServlet.processRequest(TestServlet.java:92)
      11:11:29,364 ERROR [STDERR] at com.clementsengineering.servlet.TestServlet.doPost(TestServlet.java:70)
      11:11:29,364 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      11:11:29,364 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      11:11:29,365 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      11:11:29,365 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      11:11:29,365 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      11:11:29,365 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      11:11:29,365 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      11:11:29,365 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      11:11:29,365 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      11:11:29,365 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
      11:11:29,365 ERROR [STDERR] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
      11:11:29,366 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      11:11:29,366 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      11:11:29,366 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      11:11:29,366 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      11:11:29,366 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      11:11:29,366 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      11:11:29,366 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      11:11:29,366 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      11:11:29,366 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      11:11:29,366 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
      11:11:29,367 ERROR [STDERR] Caused by: java.lang.IllegalArgumentException: Wrong target. class com.clementsengineering.session.UserActionsBean for public int com.clementsengineering.session.UserActionsBean.scheduleFlight(int,com.clementsengineering.persistence.Users)
      11:11:29,367 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.handleErrors(MethodInvocation.java:141)
      11:11:29,367 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:116)
      11:11:29,367 ERROR [STDERR] at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
      11:11:29,367 ERROR [STDERR] at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
      11:11:29,367 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      11:11:29,368 ERROR [STDERR] at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
      11:11:29,368 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      11:11:29,368 ERROR [STDERR] at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
      11:11:29,368 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      11:11:29,368 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
      11:11:29,368 ERROR [STDERR] ... 38 more
      


      I changed the UseJBossWebLoader to true in the
      {jboss.home}/server/all/deploy/jbossweb-tomcat55.sar/META-INF/jboss-service.xml
      and that error disappeared, however I am now getting new errors:


      11:29:42,024 ERROR [STDERR] java.lang.RuntimeException: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=mahler.clementsengineering.com/14, BranchQual=, localId=14] status=STATUS_NO_TRANSACTION; - nested throwable: (javax.persistence.PersistenceException: org.hibernate.TransientObjectException: com.clementsengineering.persistence.Users)
      11:29:42,025 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.handleEndTransactionException(TxPolicy.java:198)
      11:29:42,025 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:180)
      11:29:42,025 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)
      11:29:42,025 ERROR [STDERR] at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
      11:29:42,025 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      11:29:42,025 ERROR [STDERR] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
      11:29:42,026 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      11:29:42,026 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
      11:29:42,026 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      11:29:42,026 ERROR [STDERR] at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
      11:29:42,026 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      11:29:42,026 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
      11:29:42,026 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      11:29:42,026 ERROR [STDERR] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
      11:29:42,026 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      11:29:42,026 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:181)
      11:29:42,027 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:79)
      11:29:42,027 ERROR [STDERR] at $Proxy103.scheduleFlight(Unknown Source)
      11:29:42,027 ERROR [STDERR] at com.clementsengineering.servlet.TestServlet.processRequest(TestServlet.java:92)
      11:29:42,027 ERROR [STDERR] at com.clementsengineering.servlet.TestServlet.doPost(TestServlet.java:70)
      11:29:42,027 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      11:29:42,027 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      11:29:42,027 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      11:29:42,027 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      11:29:42,027 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      11:29:42,027 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      11:29:42,027 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      11:29:42,028 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      11:29:42,028 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      11:29:42,028 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
      11:29:42,028 ERROR [STDERR] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
      11:29:42,028 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      11:29:42,028 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      11:29:42,028 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      11:29:42,028 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      11:29:42,028 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      11:29:42,028 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      11:29:42,028 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      11:29:42,029 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      11:29:42,029 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      11:29:42,029 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
      11:29:42,029 ERROR [STDERR] Caused by: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=mahler.clementsengineering.com/14, BranchQual=, localId=14] status=STATUS_NO_TRANSACTION; - nested throwable: (javax.persistence.PersistenceException: org.hibernate.TransientObjectException: com.clementsengineering.persistence.Users)
      11:29:42,029 ERROR [STDERR] at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:372)
      11:29:42,029 ERROR [STDERR] at org.jboss.tm.TxManager.commit(TxManager.java:240)
      11:29:42,029 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:175)
      11:29:42,030 ERROR [STDERR] ... 39 more
      11:29:42,030 ERROR [STDERR] Caused by: javax.persistence.PersistenceException: org.hibernate.TransientObjectException: com.clementsengineering.persistence.Users
      11:29:42,030 ERROR [STDERR] at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:567)
      11:29:42,030 ERROR [STDERR] at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:484)
      11:29:42,030 ERROR [STDERR] at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1491)
      11:29:42,030 ERROR [STDERR] at org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1110)
      11:29:42,030 ERROR [STDERR] at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:324)
      11:29:42,031 ERROR [STDERR] ... 41 more
      11:29:42,031 ERROR [STDERR] Caused by: org.hibernate.TransientObjectException: com.clementsengineering.persistence.Users
      11:29:42,031 ERROR [STDERR] at org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:216)
      11:29:42,031 ERROR [STDERR] at org.hibernate.type.EntityType.getIdentifier(EntityType.java:108)
      11:29:42,031 ERROR [STDERR] at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:221)
      11:29:42,031 ERROR [STDERR] at org.hibernate.type.TypeFactory.findDirty(TypeFactory.java:476)
      11:29:42,032 ERROR [STDERR] at org.hibernate.persister.entity.AbstractEntityPersister.findDirty(AbstractEntityPersister.java:2900)
      11:29:42,032 ERROR [STDERR] at org.hibernate.event.def.DefaultFlushEntityEventListener.dirtyCheck(DefaultFlushEntityEventListener.java:474)
      11:29:42,032 ERROR [STDERR] at org.hibernate.event.def.DefaultFlushEntityEventListener.isUpdateNecessary(DefaultFlushEntityEventListener.java:197)
      11:29:42,032 ERROR [STDERR] at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:120)
      11:29:42,032 ERROR [STDERR] at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:195)
      11:29:42,032 ERROR [STDERR] at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
      11:29:42,032 ERROR [STDERR] at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
      11:29:42,032 ERROR [STDERR] at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:993)
      11:29:42,032 ERROR [STDERR] at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:340)
      11:29:42,032 ERROR [STDERR] at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:475)
      11:29:42,033 ERROR [STDERR] ... 44 more
      


      It seems to be erroring out before it even reaches the bean code. Here's the call from the servlet:

       Users user = new Users();
       user.setUserFirstName("Fred");
       user.setUserLastName("Flintstone");
       user.setRoleNumber(1);
      
       Context jndiContext = ServiceLocator.getInitialContext();
       Object ref = jndiContext.lookup("oth/UserActionsLocal");
       UserActionsLocal ua = (UserActionsLocal)PortableRemoteObject.narrow(ref,UserActionsLocal.class);
      
       int passengerFlightInfoId = 1;
       int returnValue = ua.scheduleFlight(passengerFlightInfoId,user);
      
      


      Here's the bean code:

      
       public int scheduleFlight(int aPassengerInfoId, Users anUser) {
       System.out.println("inside schedule flight");
       return 0;
       } // end scheduleFlight(PersistenceFlightInfo,Users)
      
      


      I'm not quite sure why it is trying to commit or why it needs a transaction, there is no database functionality happening here.

      Any ideas on the problem?

      --Andy

        • 1. Re:  java.lang.RuntimeException: org.jboss.tm.JBossRollbackE
          Andy W. Clements Newbie

          Hello again,

          It seems to have something to do with passing the object. If I pass null as shown below, I get no error:

          int returnValue = ua.scheduleFlight(passengerFlightInfoId,null);
          


          OK, so what is wrong with the object? Here it is:

          
          package com.clementsengineering.persistence;
          
          import javax.persistence.*;
          
          @Entity
          @Table(name="XXX_users")
          public class Users implements java.io.Serializable {
          
           private int user_id;
           private String user_login;
           private String user_email;
           private String user_first_name;
           private String user_last_name;
           private int role_number;
          
           @Id
           @GeneratedValue
           @Column(name="user_id")
           public int getUserId() { return user_id; }
          
           public void setUserId(int anUserId) { this.user_id = anUserId; }
          
           @Column(name="user_login")
           public String getUserLogin() { return user_login; }
          
           public void setUserLogin(String anUserLogin) { this.user_login = anUserLogin; }
          
           @Column(name="user_email")
           public String getUserEmail() { return user_email; }
          
           public void setUserEmail(String anUserEmail) { this.user_email = anUserEmail; }
          
           @Column(name="user_first_name")
           public String getUserFirstName() { return user_first_name; }
          
           public void setUserFirstName(String anUserFirstName) { this.user_first_name = anUserFirstName; }
          
           @Column(name="user_last_name")
           public String getUserLastName() { return user_last_name; }
          
           public void setUserLastName(String anUserLastName) { this.user_last_name = anUserLastName; }
          
           @Column(name="role_number")
           public int getRoleNumber() { return role_number; }
          
           public void setRoleNumber(int aRoleNumber) { this.role_number = aRoleNumber; }
          
          } // end class Users
          
          


          I pass other similar EJB3 persistence objects in other servlets with no problem, so what is happening here?

          Thanks in advance!
          Andy

          • 2. Re:  java.lang.RuntimeException: org.jboss.tm.JBossRollbackE
            tldtld Newbie

            Did you ever solve this issue? I'm having it now myself

            • 3. Re:  java.lang.RuntimeException: org.jboss.tm.JBossRollbackE
              Andy W. Clements Newbie

              Yes, it happened that my build script was screwed up, so it wasn't building the jar file every time I updated the code. After I fixed the buidl script and the jar file got built, everything worked. Unfortunately, I don't know what the problem was that was causing the error, since I mucked with the code about a thousand times before I fixed the build script. - I suspect it was one of my settings files that was not inline with the java code, but I'll never know. Sorry I could help more.