3 Replies Latest reply on Oct 26, 2007 9:35 AM by shilpa kumar

    Seam 2 B1 - Ending a process instance fails.

    Jamie Cruise Newbie

      Tomcat 6
      Seam 2 B1
      Jboss Embedded Beta 2

      Signalling the last task on a process causes the following exception:

      Caused by: org.jbpm.JbpmException: couldn't delete jobs for 'org.jbpm.graph.exe.ProcessInstance@1661834'
       at org.jbpm.db.JobSession.deleteJobsForProcessInstance(JobSession.java:211)
       at org.jbpm.scheduler.db.DbSchedulerService.deleteTimersByProcessInstance(DbSchedulerService.java:54)
       at org.jbpm.graph.exe.ProcessInstance.end(ProcessInstance.java:329)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:147)
       at org.jbpm.graph.exe.ProcessInstance$$EnhancerByCGLIB$$b594bd1c.end(<generated>)
       at org.jbpm.graph.exe.Token.notifyParentOfTokenEnd(Token.java:331)
       at org.jbpm.graph.exe.Token.end(Token.java:303)
       at org.jbpm.graph.exe.Token.end(Token.java:253)
       at org.jbpm.graph.node.EndState.execute(EndState.java:59)
       at org.jbpm.graph.def.Node.enter(Node.java:318)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:147)
       at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$1483760f.enter(<generated>)
       at org.jbpm.graph.def.Transition.take(Transition.java:151)
       at org.jbpm.graph.def.Node.leave(Node.java:393)
       at org.jbpm.graph.def.Node.leave(Node.java:357)
       at org.jbpm.graph.def.Node.execute(Node.java:349)
       at org.jbpm.graph.def.Node.enter(Node.java:318)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:147)
       at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$1483760f.enter(<generated>)
       at org.jbpm.graph.def.Transition.take(Transition.java:151)
       at org.jbpm.graph.def.Node.leave(Node.java:393)
       at org.jbpm.graph.node.StartState.leave(StartState.java:70)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:147)
       at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$1483760f.leave(<generated>)
       at org.jbpm.graph.exe.Token.signal(Token.java:194)
       at org.jbpm.graph.exe.Token.signal(Token.java:139)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:147)
       at org.jbpm.graph.exe.Token$$EnhancerByCGLIB$$43dce38b.signal(<generated>)
       at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:476)
       at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:390)
       at org.jboss.seam.bpm.BusinessProcess.endTask(BusinessProcess.java:195)
       at com.volantice.zone.action.TaskBean.endTask(TaskBean.java:77)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
       at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
       at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
       at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
       at org.jboss.seam.core.ConversationInterceptor.aroundInvoke(ConversationInterceptor.java:54)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
       at org.jboss.seam.bpm.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:49)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
       at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38)
       at org.jboss.seam.util.Work.workInTransaction(Work.java:39)
       at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
       at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
       at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
       at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:151)
       at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:87)
       at com.volantice.zone.action.TaskBean_$$_javassist_5.endTask(TaskBean_$$_javassist_5.java)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:325)
       at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:338)
       at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
       at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
       at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
       at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
       at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
       ... 39 more
      Caused by: org.hibernate.TransactionException: could not register synchronization
       at org.hibernate.transaction.JTATransaction.registerSynchronization(JTATransaction.java:309)
       at org.jbpm.db.JobSession.deleteJobsForProcessInstance(JobSession.java:208)
       ... 126 more
      Caused by: java.lang.NullPointerException
       at org.hibernate.transaction.JTATransaction.registerSynchronization(JTATransaction.java:306)
       ... 127 more
      


      The code that raises the error is in: org.hibernate.transaction.JTATransaction.

      public void registerSynchronization(Synchronization sync) throws HibernateException {
       if (getTransactionManager()==null) {
       throw new IllegalStateException("JTA TransactionManager not available");
       }
       else {
       try {
       getTransactionManager().getTransaction().registerSynchronization(sync);
       }
       catch (Exception e) {
       throw new TransactionException("could not register synchronization", e);
       }
       }
       }
      


      So I guess the getTransaction() call is returning null.

      Has anybody else had problems ending JBPM process instances in Seam2?

      Obviously this all worked for me in 1.2.1GA.

      What version of JBPM is used in Seam2? it's not 3.2.GA.

      Cheers
      J

        • 1. Re: Seam 2 B1 - Ending a process instance fails.
          Jamie Cruise Newbie

          built latest seam and jbpm-jpdl from cvs. Same problem.

          Workaround is to disable the db scheduler service in jbpm.cfg.xml.

          Cheers
          J

          • 2. Re: Seam 2 B1 - Ending a process instance fails.
            Pete Muir Master

            It's a build from about 1 week before 3.2.1.GA was released I think (3.2.1.GA wasn't released in time for our BETA). Seam 2.0.0.CR1 should have 3.2.1.GA in.

            • 3. Re: Seam 2 B1 - Ending a process instance fails.
              shilpa kumar Newbie

              I am also getting the same error. I am working on jbpm3.2.2\jbpm-jpdl-3.2.2 & websphere 6. I am able to connect and give token.signal but at state-end i am getting this error.

              org.jbpm.db.JobSession deleteJobsForProcessInstance org.hibernate.TransactionException: Could not register synchronization
              

              Can you please help me. I already running behind time. and saw all sites from almost 2 weeks. but still not getting any solution.....

              plz help me.

              my jbpm.cfg.xml is
              
              <jbpm-configuration>
              
               <jbpm-context>
               <service name="persistence">
               <factory>
               <bean class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
               <field name="isTransactionEnabled"><false /></field>
               <field name="isCurrentSessionEnabled"><false /></field>
               </bean>
               </factory>
               </service>
               <service name="tx" factory="org.jbpm.tx.TxServiceFactory" />
               <service name="message" factory="org.jbpm.msg.db.DbMessageServiceFactory" />
               <service name="scheduler" factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" />
               <service name="logging" factory="org.jbpm.logging.db.DbLoggingServiceFactory" />
               <service name="authentication" factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory" />
               </jbpm-context>
              
               <!-- configuration resource files pointing to default configuration files in jbpm-{version}.jar -->
               <string name="resource.hibernate.cfg.xml" value="hibernate.cfg.xml" />
               <!-- <string name="resource.hibernate.properties" value="hibernate.properties" /> -->
               <string name="resource.business.calendar" value="org/jbpm/calendar/jbpm.business.calendar.properties" />
               <string name="resource.default.modules" value="org/jbpm/graph/def/jbpm.default.modules.properties" />
               <string name="resource.converter" value="org/jbpm/db/hibernate/jbpm.converter.properties" />
               <string name="resource.action.types" value="org/jbpm/graph/action/action.types.xml" />
               <string name="resource.node.types" value="org/jbpm/graph/node/node.types.xml" />
               <string name="resource.parsers" value="org/jbpm/jpdl/par/jbpm.parsers.xml" />
               <string name="resource.varmapping" value="org/jbpm/context/exe/jbpm.varmapping.xml" />
              
               <bean name="jbpm.task.instance.factory" class="org.jbpm.taskmgmt.impl.DefaultTaskInstanceFactoryImpl" singleton="true" />
               <bean name="jbpm.variable.resolver" class="org.jbpm.jpdl.el.impl.JbpmVariableResolver" singleton="true" />
               <long name="jbpm.msg.wait.timout" value="5000" singleton="true" />
              
              
              </jbpm-configuration>
              
              

              my hibernate.cfg.xml is as follows
               <property name="hibernate.dialect">org.hibernate.dialect.Oracle9iDialect</property>
              
              
               <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
              
               <!-- Websphere -->
               <property name="hibernate.jdbc.batch_size">0</property>
               <property name="hibernate.connection.datasource">jdbc/JbpmDS</property>
               <property name="hibernate.TransactionManagerLookup">org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</property>
               <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</property>
               <property name="hibernate.TransactionManagerLookupStrategy">org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</property>
               <property name="transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</property>
               <property name="hibernate.show_sql">true</property>
              
              
               <property name="hibernate.transaction.flush_before_completion">true</property>
              


              Please help me ASAP