0 Replies Latest reply on Nov 30, 2011 6:40 AM by Miloud Haimoune

    jbpm5 seam 2.2.2 integration issue

    Miloud Haimoune Newbie

      Hi all,

       

      I am integrating Jbpm5 with existing application developed using seam2.2.2. With a separate database for jbpm. I created a persisted ksession and it is working correctly.

      Persistence.xml

       

      <persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA">

      <provider>org.hibernate.ejb.HibernatePersistence</provider>

      <jta-data-source>java:jdbc/testDS1</jta-data-source>

      <mapping-file>META-INF/JBPMorm.xml</mapping-file>

        <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>

      <class>org.drools.persistence.info.SessionInfo</class>

      <class>org.drools.persistence.info.WorkItemInfo</class>

      <class>org.jbpm.process.audit.ProcessInstanceLog</class>

      <class>org.jbpm.process.audit.NodeInstanceLog</class>

      <class>org.jbpm.process.audit.VariableInstanceLog</class>

      <properties>

      <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>

      <property name="hibernate.max_fetch_depth" value="3"/>

      <!-- <property name="hibernate.hbm2ddl.auto" value="create"/>    -->

      <property name="hibernate.show_sql" value="false" />

      <property name="hibernate.format_sql" value="false" />

       

      <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />

      </properties>

      </persistence-unit>

       

      I needed to access the  processinstance variables to delegate a humane task to another user if the actual user did not complete the task after one hour. I am using a timer to trigger  custom service task registered with a custom workItemHandler.

       

      My issue : the transaction is canceled after time the timeout (300s)

       

      WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] (Thread-9) [com.arjuna.ats.arjuna.coordinator.TransactionReaper_18] - TransactionReaper::check timeout for TX 7f000101:e18b:4ed4a5a4:10b in state  RUN

      WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] (Thread-10) [com.arjuna.ats.arjuna.coordinator.BasicAction_58] - Abort of action id 7f000101:e18b:4ed4a5a4:10b invoked while multiple threads active within it.

      WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] (Thread-10) [com.arjuna.ats.arjuna.coordinator.CheckedAction_2] - CheckedAction::check - atomic action 7f000101:e18b:4ed4a5a4:10b aborting with 1 threads active!

      WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] (Thread-10) [com.arjuna.ats.arjuna.coordinator.TransactionReaper_7] - TransactionReaper::doCancellations worker Thread[Thread-10,5,jboss] successfully canceled TX 7f000101:e18b:4ed4a5a4:10b

       

       

       

       

      javax.persistence.TransactionRequiredException: No active JTA transaction on joinTransaction call

      at org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:458)

      at org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:431)

      at org.drools.persistence.jpa.JpaPersistenceContextManager.beginCommandScopedEntityManager(JpaPersistenceContextManager.java:66)

      at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:287)

      at org.drools.persistence.jpa.JpaJDKTimerService$JpaJDKCallableJob.call(JpaJDKTimerService.java:75)

      at org.drools.persistence.jpa.JpaJDKTimerService$JpaJDKCallableJob.call(JpaJDKTimerService.java:63)

      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

      at java.util.concurrent.FutureTask.run(FutureTask.java:138)

      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)

      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)

      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

      at java.lang.Thread.run(Thread.java:662)

       

      the work item handler

      public class SamplelWorkItemHandler implements WorkItemHandler {

       

      public void executeWorkItem(WorkItem workItem, WorkItemManager workItemManager) {

         

      ProcessInstance processInstance = (ProcessInstance) ProcessManager.getProcessInstance(workItem.getProcessInstanceId());

       

      workItemManager.completeWorkItem(workItem.getId(), null );

          }

       

      public void abortWorkItem(WorkItem workItem, WorkItemManager workItemManager) {

       

          }

      }

       

       

      any suggestion ??,

       

      Many thanks.