3 Replies Latest reply on Feb 7, 2007 9:24 AM by nloomis

    Transaction Exception with Seam and EJB3

    nloomis

      Hi, I'm having problems synchronizing with the JTA Transaction Manager from within a Seam component when I come from an MDB that is not a Seam component. I tried making the MDB a Seam component but Seam didn't like that (another issue I'm not concerned about at the moment because I switched it to use all EJB3 annotations). Now, I keep getting a Transaction Exception when my stateless beans try to process. The code is below. I've tried changing the Transaction Attribute of the MDB to unsupported and the method attribute to Required but I still get the error. Any help is greatly appreciated.

      Exception
      ---------------------------------------------------------------------------
      09:40:26,295 WARN [TransactionImpl] Transaction TransactionImpl:XidImpl[FormatId=257, GlobalId=3Q9HWB1/14, BranchQual=, localId=14] timed out. status=STATUS_ACTIVE
      09:40:28,185 INFO [ProvisionSuccessBean] confirmProvisioning: 24243
      09:40:36,888 INFO [ProvisionSuccessBean] injected jbpmConext -> org.jbpm.JbpmContext@1885947
      09:40:45,560 ERROR [STDERR] org.hibernate.TransactionException: could not register synchronization with JTA TransactionManager
      at org.hibernate.jdbc.JDBCContext.registerSynchronizationIfPossible(JDBCContext.java:174)
      at org.hibernate.impl.SessionImpl.checkTransactionSynchStatus(SessionImpl.java:1850)
      at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:868)
      at org.hibernate.impl.SessionImpl.get(SessionImpl.java:808)
      at org.hibernate.impl.SessionImpl.get(SessionImpl.java:801)
      at org.jbpm.db.GraphSession.getProcessInstance(GraphSession.java:291)
      at org.jbpm.JbpmContext.getProcessInstance(JbpmContext.java:331)
      at com.evergreen.accesscontrol.impl.ProvisionSuccessBean.confirmProvisioning(ProvisionSuccessBean.java:67)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
      at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
      at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:37)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
      at org.jboss.seam.interceptors.BijectionInterceptor.bijectTargetComponent(BijectionInterceptor.java:51)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
      at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
      at org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:23)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
      at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
      at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:51)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
      at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
      at org.jboss.seam.interceptors.BusinessProcessInterceptor.manageBusinessProcessContext(BusinessProcessInterceptor.java:50)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
      at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
      at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
      at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
      at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:112)
      at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:49)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
      at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
      at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:201)
      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:78)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
      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:227)
      at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:59)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102)
      at $Proxy202.confirmProvisioning(Unknown Source)
      at com.evergreen.accesscontrol.impl.AccessControlReceiveMDB.onMessage(AccessControlReceiveMDB.java:77)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
      at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
      at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:37)
      at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:97)
      at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:49)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
      at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocat
      09:40:45,592 ERROR [STDERR] ion.java:101)
      at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
      at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:201)
      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.ejb3.mdb.MDB.localInvoke(MDB.java:865)
      at org.jboss.ejb3.mdb.MDB.localInvoke(MDB.java:844)
      at org.jboss.ejb3.mdb.MDB$MessageListenerImpl.onMessage(MDB.java:1074)
      at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:266)
      at progress.message.jimpl.Session.dU_(Unknown Source)
      at progress.message.jimpl.Session.run(Unknown Source)
      at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:196)
      at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: javax.transaction.RollbackException: Already marked for rollback TransactionImpl:XidImpl[FormatId=257, GlobalId=3Q9HWB1/14, BranchQual=, localId=14]
      at org.jboss.tm.TransactionImpl.registerSynchronization(TransactionImpl.java:635)
      at org.hibernate.jdbc.JDBCContext.registerSynchronizationIfPossible(JDBCContext.java:164)
      ... 115 more



      MDB
      ------------------------------------------------------------------------------
      @MessageDriven(activationConfig = {
      @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
      @ActivationConfigProperty(propertyName = "destination", propertyValue = "java:/SonicJMS/Queues/AccessControl/Receive"),
      @ActivationConfigProperty(propertyName = "providerAdapterJNDI", propertyValue = "java:/SonicJMSProvider"),
      @ActivationConfigProperty(propertyName = "useDLQ", propertyValue = "false")
      }
      )
      @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
      public class AccessControlReceiveMDB implements MessageListener {

      // public static final String ACCESS_DATA_XPATH = "declare namespace
      // ac='http://www.evergreeninvestments.com/accessControl' "
      // + "declare namespace xsi='http://www.w3.org/2001/XMLSchema-instance' "
      // + ".//ac:accessData";

      private Log log = LogFactory.getLog(AccessControlReceiveMDB.class);

      @EJB(beanName="ProvisionSuccessBean")
      private ProvisionSuccess successfulResponse;

      @EJB(beanName="ProvisionFailureBean")
      private ProvisionFailure failedResponse;

      /*
      * (non-Javadoc)
      *
      * @see com.evergreen.accesscontrol.impl.AccessControlReceive#onMessage(javax.jms.Message)
      */
      //@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
      public void onMessage(javax.jms.Message message) {
      log.info("Message Received!");
      log.info(message);
      try {
      // Grab Message Type from header.
      MessageTypes messageType = null;
      try {
      messageType = MessageTypes.valueOf(message
      .getStringProperty(MessageHeaderKeys.MessageType
      .toString()));
      } catch (Exception e) {
      messageType = MessageTypes.ProvisionFailure;
      }
      log.info("MessageType -> " + messageType.toString());

      Long processId = null;

      switch (messageType) {
      case ProvisionSuccess:
      // Grab process id from header.
      try {
      processId = Long.valueOf(message.getStringProperty(MessageHeaderKeys.ProcessId.toString()));
      } catch (Exception e) {
      throw new Exception("Missing Process Id in Message Header. " + e);
      }

      successfulResponse.confirmProvisioning(processId);
      break;


      ProvisionSuccessBean - Stateless EJB
      ----------------------------------------------------------------------------------
      @Stateless
      @Name("provisionSuccess")
      public class ProvisionSuccessBean implements ProvisionSuccess {

      @Logger
      protected Log log;

      @PersistenceContext(unitName = "controlDatabase")
      protected EntityManager em;

      @In(create = true)
      private JbpmContext jbpmContext;

      /*
      * (non-Javadoc)
      *
      * @see com.evergreen.accesscontrol.message.ProvisionResponse#confirmProvisioning()
      */
      public String confirmProvisioning(Long processId) {
      log.info("confirmProvisioning: " + processId);

      // Load the JBPM context and the task
      log.info("injected jbpmConext -> " + jbpmContext);

      try {
      ProcessInstance process = jbpmContext.getProcessInstance(processId); <--------- exception occurs here
      Long accessRequestId = (Long) process.getContextInstance()
      .getVariable("accessRequestId");

        • 1. Re: Transaction Exception with Seam and EJB3
          gavin.king

          What is probably happening is that the real underlying exception is being swallowed. So use your debugger to find the real cause. There are other posts about this in the forum.

          • 2. Re: Transaction Exception with Seam and EJB3
            nloomis

            Thanks! I took your advice and researched the forums and tried handling the transaction several different ways to see if I could find the error behind the error. I see this one debug statement about 1000 times in my debugger. It starts during the JBpm deploy and seems directly related to my problem. Any help with this??

            Here's where the message starts in my log...
            -------------------------------------------------------------------------------

            2007-02-06 16:29:10,102 DEBUG [org.hibernate.hql.ast.AST] --- SQL AST ---
            \-[DELETE] DeleteStatement: 'delete' querySpaces (JBPM_MESSAGE)
            +-[FROM] FromClause: 'FROM' FromClause{level=1, fromElementCounter=1, fromElements=1, fromElementByClassAlias=[m], fromElementByTableAlias=[message0_], fromElementsByPath=[], collectionJoinFromElementsByPath=[], impliedElements=[]}
            | \-[FROM_FRAGMENT] FromElement: 'JBPM_MESSAGE' FromElement{explicit,not a collection join,not a fetch join,fetch non-lazy properties,classAlias=m,role=null,tableName=JBPM_MESSAGE,tableAlias=message0_,origin=null,colums={,className=org.jbpm.msg.Message}}
            \-[WHERE] SqlNode: 'where'
            \-[EQ] BinaryLogicOperatorNode: '='
            +-[DOT] DotNode: 'TOKEN_' {propertyName=token,dereferenceType=ROOT_LEVEL,propertyPath=token,path=m.token,tableAlias=message0_,className=org.jbpm.msg.Message,classAlias=m}
            | +-[ALIAS_REF] IdentNode: 'ID_' {alias=m, className=org.jbpm.msg.Message, tableAlias=message0_}
            | \-[IDENT] IdentNode: 'token' {originalText=token}
            \-[NAMED_PARAM] ParameterNode: '?' {name=token, expectedType=org.hibernate.type.ManyToOneType(org.jbpm.graph.exe.Token)}

            2007-02-06 16:29:10,102 DEBUG [org.hibernate.hql.ast.ErrorCounter] throwQueryException() : no errors
            2007-02-06 16:29:10,102 DEBUG [org.hibernate.hql.ast.ErrorCounter] throwQueryException() : no errors
            2007-02-06 16:29:10,102 DEBUG [org.hibernate.impl.SessionFactoryImpl] Checking 0 named SQL queries
            2007-02-06 16:29:10,102 DEBUG [org.jbpm.persistence.db.DbPersistenceService] creating hibernate session
            2007-02-06 16:29:10,790 DEBUG [org.hibernate.impl.SessionImpl] opened session at timestamp: 4795585946083328
            2007-02-06 16:29:10,790 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@a1ee92, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@395626{ url=null ,addedOrder=0}
            2007-02-06 16:29:10,790 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@a1ee92, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@46f28c{ url=null ,addedOrder=0}
            2007-02-06 16:29:10,837 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
            2007-02-06 16:29:10,837 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
            2007-02-06 16:29:10,852 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@a1ee92, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@7958ef{ url=null ,addedOrder=0}
            2007-02-06 16:29:10,852 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
            2007-02-06 16:29:10,868 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
            2007-02-06 16:29:10,868 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
            2007-02-06 16:29:10,868 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
            2007-02-06 16:29:10,868 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
            2007-02-06 16:29:10,868 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
            2007-02-06 16:29:10,868 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
            2007-02-06 16:29:10,868 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
            2007-02-06 16:29:10,868 DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection
            2007-02-06 16:29:10,915 DEBUG [org.hibernate.SQL] select * from ( select processdef0_.ID_ as ID1_31_, processdef0_.NAME_ as NAME2_31_, processdef0_.VERSION_ as VERSION3_31_, processdef0_.ISTERMINATIONIMPLICIT_ as ISTERMIN4_31_, processdef0_.STARTSTATE_ as STARTSTATE5_31_ from JBPM_PROCESSDEFINITION processdef0_ where processdef0_.NAME_=? order by processdef0_.VERSION_ desc ) where rownum <= ?
            2007-02-06 16:29:11,227 DEBUG [org.hibernate.loader.hql.QueryLoader] bindNamedParameters() RequestNewAccess -> name [1]
            2007-02-06 16:29:11,243 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
            2007-02-06 16:29:11,321 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open ResultSet (open ResultSets: 0, globally: 0)
            2007-02-06 16:29:11,321 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
            2007-02-06 16:29:11,337 DEBUG [org.hibernate.loader.Loader] result row: EntityKey[org.jbpm.graph.def.ProcessDefinition#24811]
            2007-02-06 16:29:11,337 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
            2007-02-06 16:29:11,337 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
            2007-02-06 16:29:11,352 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
            2007-02-06 16:29:11,352 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
            ...


            We have copied the configuration of Gavin's project exactly per his request to Brad. However, I'm curious whether we have the right properties set in the jbm-hibernate.cfg.xml. I don't have the following properties set for the JTATransaction,

            hibernate.jndi.url JNDI initial context URL
            hibernate.jndi.class JNDI provider class
            jta.UserTransaction JNDI name

            I plan to plug these in and try it. I might also try the CMTTransactionFactory insteand of the JTATransactionFactory. Again, I have checked the forums and can't find any advice so help is definitely appreciated.

            • 3. Re: Transaction Exception with Seam and EJB3
              nloomis

              Thanks! I took your advice and researched the forums and tried handling the transaction several different ways to see if I could find the error behind the error. I see this one debug statement about 1000 times in my debugger. It starts during the JBpm deploy and seems directly related to my problem. Any help with this??

              Here's where the message starts in my log...
              -------------------------------------------------------------------------------

              2007-02-06 16:29:10,102 DEBUG [org.hibernate.hql.ast.AST] --- SQL AST ---
              \-[DELETE] DeleteStatement: 'delete' querySpaces (JBPM_MESSAGE)
              +-[FROM] FromClause: 'FROM' FromClause{level=1, fromElementCounter=1, fromElements=1, fromElementByClassAlias=[m], fromElementByTableAlias=[message0_], fromElementsByPath=[], collectionJoinFromElementsByPath=[], impliedElements=[]}
              | \-[FROM_FRAGMENT] FromElement: 'JBPM_MESSAGE' FromElement{explicit,not a collection join,not a fetch join,fetch non-lazy properties,classAlias=m,role=null,tableName=JBPM_MESSAGE,tableAlias=message0_,origin=null,colums={,className=org.jbpm.msg.Message}}
              \-[WHERE] SqlNode: 'where'
              \-[EQ] BinaryLogicOperatorNode: '='
              +-[DOT] DotNode: 'TOKEN_' {propertyName=token,dereferenceType=ROOT_LEVEL,propertyPath=token,path=m.token,tableAlias=message0_,className=org.jbpm.msg.Message,classAlias=m}
              | +-[ALIAS_REF] IdentNode: 'ID_' {alias=m, className=org.jbpm.msg.Message, tableAlias=message0_}
              | \-[IDENT] IdentNode: 'token' {originalText=token}
              \-[NAMED_PARAM] ParameterNode: '?' {name=token, expectedType=org.hibernate.type.ManyToOneType(org.jbpm.graph.exe.Token)}

              2007-02-06 16:29:10,102 DEBUG [org.hibernate.hql.ast.ErrorCounter] throwQueryException() : no errors
              2007-02-06 16:29:10,102 DEBUG [org.hibernate.hql.ast.ErrorCounter] throwQueryException() : no errors
              2007-02-06 16:29:10,102 DEBUG [org.hibernate.impl.SessionFactoryImpl] Checking 0 named SQL queries
              2007-02-06 16:29:10,102 DEBUG [org.jbpm.persistence.db.DbPersistenceService] creating hibernate session
              2007-02-06 16:29:10,790 DEBUG [org.hibernate.impl.SessionImpl] opened session at timestamp: 4795585946083328
              2007-02-06 16:29:10,790 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@a1ee92, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@395626{ url=null ,addedOrder=0}
              2007-02-06 16:29:10,790 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@a1ee92, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@46f28c{ url=null ,addedOrder=0}
              2007-02-06 16:29:10,837 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
              2007-02-06 16:29:10,837 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
              2007-02-06 16:29:10,852 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@a1ee92, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@7958ef{ url=null ,addedOrder=0}
              2007-02-06 16:29:10,852 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
              2007-02-06 16:29:10,868 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
              2007-02-06 16:29:10,868 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
              2007-02-06 16:29:10,868 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
              2007-02-06 16:29:10,868 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
              2007-02-06 16:29:10,868 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
              2007-02-06 16:29:10,868 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
              2007-02-06 16:29:10,868 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
              2007-02-06 16:29:10,868 DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection
              2007-02-06 16:29:10,915 DEBUG [org.hibernate.SQL] select * from ( select processdef0_.ID_ as ID1_31_, processdef0_.NAME_ as NAME2_31_, processdef0_.VERSION_ as VERSION3_31_, processdef0_.ISTERMINATIONIMPLICIT_ as ISTERMIN4_31_, processdef0_.STARTSTATE_ as STARTSTATE5_31_ from JBPM_PROCESSDEFINITION processdef0_ where processdef0_.NAME_=? order by processdef0_.VERSION_ desc ) where rownum <= ?
              2007-02-06 16:29:11,227 DEBUG [org.hibernate.loader.hql.QueryLoader] bindNamedParameters() RequestNewAccess -> name [1]
              2007-02-06 16:29:11,243 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
              2007-02-06 16:29:11,321 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open ResultSet (open ResultSets: 0, globally: 0)
              2007-02-06 16:29:11,321 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
              2007-02-06 16:29:11,337 DEBUG [org.hibernate.loader.Loader] result row: EntityKey[org.jbpm.graph.def.ProcessDefinition#24811]
              2007-02-06 16:29:11,337 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
              2007-02-06 16:29:11,337 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
              2007-02-06 16:29:11,352 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
              2007-02-06 16:29:11,352 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
              ...


              I'm curious whether we have the right properties set in the jbm-hibernate.cfg.xml. I don't have the following properties set for the JTATransaction,

              hibernate.jndi.url JNDI initial context URL
              hibernate.jndi.class JNDI provider class
              jta.UserTransaction JNDI name

              I plan to plug these in and try it. I might also try the CMTTransactionFactory insteand of the JTATransactionFactory. Again, I have checked the forums and can't find any advice so help is definitely appreciated.