Hi,
I try to use JBPM5.4, Spring 3.1.4, Hibernate 4.1.9, Jboss AS 7.1.1 and JBoss Transaction Manager
I create a simple function to start a process
When I just have 1 thread calling that function, everything works fine
But when I have 2 thread calling the function concurrently, I will get this error
13:54:40,867 ERROR [org.hibernate.AssertionFailure] (pool-28-thread-1) HHH000099: an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session): org.hibernate.AssertionFailure: null id in org.jbpm.persistence.processinstance.ProcessInstanceInfo entry (don't flush the Session after an exception occurs)
13:54:40,867 WARN [com.arjuna.ats.arjuna] (pool-28-thread-1) ARJUNA012125: TwoPhaseCoordinator.beforeCompletion - failed for SynchronizationImple< 0:ffffac107acb:-7ea89ad7:51beac4b:174, org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization@40608644 >: javax.persistence.PersistenceException: error during managed flush
at org.hibernate.ejb.AbstractEntityManagerImpl$CallbackExceptionMapperImpl.mapManagedFlushFailure(AbstractEntityManagerImpl.java:1505) [hibernate-entitymanager-4.1.9.Final.jar:4.1.9.Final]
at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:109) [hibernate-core-4.1.9.Final.jar:4.1.9.Final]
at org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization.beforeCompletion(RegisteredSynchronization.java:53) [hibernate-core-4.1.9.Final.jar:4.1.9.Final]
at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:273)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:93)
at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:164)
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1165)
at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:117)
at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)
at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:167)
at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1010) [spring-tx-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754) [spring-tx-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723) [spring-tx-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:387) [spring-tx-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:120) [spring-tx-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) [spring-aop-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90) [spring-aop-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) [spring-aop-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) [spring-aop-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at $Proxy257.runTest3(Unknown Source) at app.chameleon.core.taskmanagement.backend.controller.TestSpringAndJbpmController$2.run(TestSpringAndJbpmController.java:179) [classes:]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_11]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_11]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_11]
Caused by: org.hibernate.AssertionFailure: null id in org.jbpm.persistence.processinstance.ProcessInstanceInfo entry (don't flush the Session after an exception occurs)
at org.hibernate.event.internal.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:79) [hibernate-core-4.1.9.Final.jar:4.1.9.Final]
at org.hibernate.event.internal.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:194) [hibernate-core-4.1.9.Final.jar:4.1.9.Final]
at org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:156) [hibernate-core-4.1.9.Final.jar:4.1.9.Final]
at org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:225) [hibernate-core-4.1.9.Final.jar:4.1.9.Final]
at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:99) [hibernate-core-4.1.9.Final.jar:4.1.9.Final]
at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51) [hibernate-core-4.1.9.Final.jar:4.1.9.Final]
at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1213) [hibernate-core-4.1.9.Final.jar:4.1.9.Final]
at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:402) [hibernate-core-4.1.9.Final.jar:4.1.9.Final]
at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:104) [hibernate-core-4.1.9.Final.jar:4.1.9.Final]
... 23 more
13:54:40,882 ERROR [stderr] (pool-28-thread-1) org.springframework.transaction.UnexpectedRollbackException: JTA transaction unexpectedly rolled back (maybe due to a timeout); nested exception is javax.transaction.RollbackException: ARJUNA016053: Could not commit transaction.
13:54:40,882 ERROR [stderr] (pool-28-thread-1) at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1013)
13:54:40,882 ERROR [stderr] (pool-28-thread-1) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
13:54:40,882 ERROR [stderr] (pool-28-thread-1) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
13:54:40,882 ERROR [stderr] (pool-28-thread-1) at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:387)
13:54:40,882 ERROR [stderr] (pool-28-thread-1) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:120)
13:54:40,882 ERROR [stderr] (pool-28-thread-1) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
13:54:40,882 ERROR [stderr] (pool-28-thread-1) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
13:54:40,898 ERROR [stderr] (pool-28-thread-1) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
13:54:40,898 ERROR [stderr] (pool-28-thread-1) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
13:54:40,898 ERROR [stderr] (pool-28-thread-1) at $Proxy257.runTest3(Unknown Source)
13:54:40,898 ERROR [stderr] (pool-28-thread-1) at app.chameleon.core.taskmanagement.backend.controller.TestSpringAndJbpmController$2.run(TestSpringAndJbpmController.java:179)
13:54:40,898 ERROR [stderr] (pool-28-thread-1) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
13:54:40,898 ERROR [stderr] (pool-28-thread-1) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
13:54:40,898 INFO [stdout] (pool-28-thread-2) Hibernate:
13:54:40,898 ERROR [stderr] (pool-28-thread-1) at java.lang.Thread.run(Thread.java:722)
13:54:40,898 INFO [stdout] (pool-28-thread-2) insert
13:54:40,898 INFO [stdout] (pool-28-thread-2) into
13:54:40,898 ERROR [stderr] (pool-28-thread-1) Caused by: javax.transaction.RollbackException: ARJUNA016053: Could not commit transaction.
13:54:40,898 INFO [stdout] (pool-28-thread-2) ProcessInstanceInfo
13:54:40,898 ERROR [stderr] (pool-28-thread-1) at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1177)
13:54:40,898 INFO [stdout] (pool-28-thread-2) (id, lastModificationDate, lastReadDate, processId, processInstanceByteArray, startDate, state, OPTLOCK)
13:54:40,898 ERROR [stderr] (pool-28-thread-1) at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:117)
13:54:40,898 INFO [stdout] (pool-28-thread-2) values
13:54:40,898 ERROR [stderr] (pool-28-thread-1) at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)
13:54:40,898 INFO [stdout] (pool-28-thread-2) (?, ?, ?, ?, ?, ?, ?, ?)
13:54:40,898 ERROR [stderr] (pool-28-thread-1) at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:167)
13:54:40,898 ERROR [stderr] (pool-28-thread-1) at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1010)
13:54:40,898 ERROR [stderr] (pool-28-thread-1) ... 13 more
13:54:40,898 ERROR [stderr] (pool-28-thread-1) Caused by: javax.persistence.PersistenceException: error during managed flush
13:54:40,898 ERROR [stderr] (pool-28-thread-1) at org.hibernate.ejb.AbstractEntityManagerImpl$CallbackExceptionMapperImpl.mapManagedFlushFailure(AbstractEntityManagerImpl.java:1505)
13:54:40,898 ERROR [stderr] (pool-28-thread-1) at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:109)
13:54:40,898 ERROR [stderr] (pool-28-thread-1) at org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization.beforeCompletion(RegisteredSynchronization.java:53)
13:54:40,898 ERROR [stderr] (pool-28-thread-1) at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76)
13:54:40,898 ERROR [stderr] (pool-28-thread-1) at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:273)
13:54:40,898 ERROR [stderr] (pool-28-thread-1) at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:93)
13:54:40,898 ERROR [stderr] (pool-28-thread-1) at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:164)
13:54:40,898 ERROR [stderr] (pool-28-thread-1) at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1165)
13:54:40,898 ERROR [stderr] (pool-28-thread-1) ... 17 more
13:54:40,898 ERROR [stderr] (pool-28-thread-1) Caused by: org.hibernate.AssertionFailure: null id in org.jbpm.persistence.processinstance.ProcessInstanceInfo entry (don't flush the Session after an exception occurs)
13:54:40,898 ERROR [stderr] (pool-28-thread-1) at org.hibernate.event.internal.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:79)
13:54:40,898 ERROR [stderr] (pool-28-thread-1) at org.hibernate.event.internal.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:194)
13:54:40,898 ERROR [stderr] (pool-28-thread-1) at org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:156)
13:54:40,898 ERROR [stderr] (pool-28-thread-1) at org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:225)
13:54:40,898 ERROR [stderr] (pool-28-thread-1) at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:99)
13:54:40,898 ERROR [stderr] (pool-28-thread-1) at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
13:54:40,898 ERROR [stderr] (pool-28-thread-1) at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1213)
13:54:40,898 ERROR [stderr] (pool-28-thread-1) at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:402)
13:54:40,898 ERROR [stderr] (pool-28-thread-1) at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:104)
13:54:40,898 ERROR [stderr] (pool-28-thread-1) ... 23 more
13:54:40,913 INFO [stdout] (pool-28-thread-2) ERROR [17-06-2013 13:54:40,913]
13:54:40,913 INFO [stdout] (pool-28-thread-2) app.chameleon.core.taskmanagement.backend.bl.interfaces.ITestSpringAndJbpm
13:54:40,913 INFO [stdout] (pool-28-thread-2) An exception in method : runTest3
13:54:40,913 INFO [stdout] (pool-28-thread-2) With following argument(s) : [2]
13:54:40,913 INFO [stdout] (pool-28-thread-2) Message : [com.salaboy.process.AsyncInteractions:12.402 - User Interaction 1:2] -- EntityManager is closed
13:54:40,913 INFO [stdout] (pool-28-thread-2) Stack Trace : org.jbpm.workflow.instance.WorkflowRuntimeException: [com.salaboy.process.AsyncInteractions:12.402 - User Interaction 1:2] -- EntityManager is closed
13:54:40,913 INFO [stdout] (pool-28-thread-2) at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:132)
13:54:40,913 INFO [stdout] (pool-28-thread-2) at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:279)
13:54:40,913 INFO [stdout] (pool-28-thread-2) at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:238)
13:54:40,913 INFO [stdout] (pool-28-thread-2) at org.jbpm.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:49)
13:54:40,913 INFO [stdout] (pool-28-thread-2) at org.jbpm.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:41)
13:54:40,913 INFO [stdout] (pool-28-thread-2) at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:126)
13:54:40,913 INFO [stdout] (pool-28-thread-2) at org.jbpm.ruleflow.instance.RuleFlowProcessInstance.internalStart(RuleFlowProcessInstance.java:35)
13:54:40,913 INFO [stdout] (pool-28-thread-2) at org.jbpm.process.instance.impl.ProcessInstanceImpl.start(ProcessInstanceImpl.java:194)
13:54:40,913 INFO [stdout] (pool-28-thread-2) at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.start(WorkflowProcessInstanceImpl.java:309)
13:54:40,913 INFO [stdout] (pool-28-thread-2) at org.jbpm.process.instance.ProcessRuntimeImpl.startProcessInstance(ProcessRuntimeImpl.java:170)
13:54:40,913 INFO [stdout] (pool-28-thread-2) at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:140)
13:54:40,913 INFO [stdout] (pool-28-thread-2) at org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1098)
13:54:40,913 INFO [stdout] (pool-28-thread-2) at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:320)
13:54:40,913 INFO [stdout] (pool-28-thread-2) at org.drools.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:120)
13:54:40,913 INFO [stdout] (pool-28-thread-2) at org.drools.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:39)
13:54:40,913 INFO [stdout] (pool-28-thread-2) at org.drools.command.impl.DefaultCommandService.execute(DefaultCommandService.java:36)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:373)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:223)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at app.chameleon.core.taskmanagement.backend.bl.TestSpringAndJbpm.runTest3(TestSpringAndJbpm.java:121)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at java.lang.reflect.Method.invoke(Method.java:601)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at app.chameleon.core.taskmanagement.backend.utilities.log.LogUtil.logAround(LogUtil.java:70)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at java.lang.reflect.Method.invoke(Method.java:601)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:55)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at $Proxy257.runTest3(Unknown Source)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at app.chameleon.core.taskmanagement.backend.controller.TestSpringAndJbpmController$2.run(TestSpringAndJbpmController.java:179)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at java.lang.Thread.run(Thread.java:722)
13:54:40,929 INFO [stdout] (pool-28-thread-2) Caused by: java.lang.IllegalStateException: EntityManager is closed
13:54:40,929 INFO [stdout] (pool-28-thread-2) at org.hibernate.ejb.EntityManagerImpl.getSession(EntityManagerImpl.java:95)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:865)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at sun.reflect.GeneratedMethodAccessor115.invoke(Unknown Source)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at java.lang.reflect.Method.invoke(Method.java:601)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:365)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at $Proxy179.persist(Unknown Source)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at org.drools.persistence.jpa.JpaPersistenceContext.persist(JpaPersistenceContext.java:46)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.internalExecuteWorkItem(JPAWorkItemManager.java:43)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:107)
13:54:40,929 INFO [stdout] (pool-28-thread-2) at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:126)
13:54:40,929 INFO [stdout] (pool-28-thread-2) ... 47 more
13:54:40,929 INFO [stdout] (pool-28-thread-2)
13:54:40,929 INFO [stdout] (pool-28-thread-2) -------------------------------------------------------
13:54:40,929 ERROR [stderr] (pool-28-thread-2) org.jbpm.workflow.instance.WorkflowRuntimeException: [com.salaboy.process.AsyncInteractions:12.402 - User Interaction 1:2] -- EntityManager is closed
13:54:40,929 ERROR [stderr] (pool-28-thread-2) at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:132)
13:54:40,929 ERROR [stderr] (pool-28-thread-2) at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:279)
13:54:40,929 ERROR [stderr] (pool-28-thread-2) at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:238)
13:54:40,929 ERROR [stderr] (pool-28-thread-2) at org.jbpm.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:49)
13:54:40,929 ERROR [stderr] (pool-28-thread-2) at org.jbpm.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:41)
13:54:40,929 ERROR [stderr] (pool-28-thread-2) at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:126)
13:54:40,929 ERROR [stderr] (pool-28-thread-2) at org.jbpm.ruleflow.instance.RuleFlowProcessInstance.internalStart(RuleFlowProcessInstance.java:35)
13:54:40,929 ERROR [stderr] (pool-28-thread-2) at org.jbpm.process.instance.impl.ProcessInstanceImpl.start(ProcessInstanceImpl.java:194)
13:54:40,929 ERROR [stderr] (pool-28-thread-2) at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.start(WorkflowProcessInstanceImpl.java:309)
13:54:40,929 ERROR [stderr] (pool-28-thread-2) at org.jbpm.process.instance.ProcessRuntimeImpl.startProcessInstance(ProcessRuntimeImpl.java:170)
13:54:40,929 ERROR [stderr] (pool-28-thread-2) at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:140)
13:54:40,929 ERROR [stderr] (pool-28-thread-2) at org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1098)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:320)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at org.drools.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:120)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at org.drools.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:39)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at org.drools.command.impl.DefaultCommandService.execute(DefaultCommandService.java:36)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:373)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:223)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at app.chameleon.core.taskmanagement.backend.bl.TestSpringAndJbpm.runTest3(TestSpringAndJbpm.java:121)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at java.lang.reflect.Method.invoke(Method.java:601)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at app.chameleon.core.taskmanagement.backend.utilities.log.LogUtil.logAround(LogUtil.java:70)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at java.lang.reflect.Method.invoke(Method.java:601)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:55)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at $Proxy257.runTest3(Unknown Source)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at app.chameleon.core.taskmanagement.backend.controller.TestSpringAndJbpmController$2.run(TestSpringAndJbpmController.java:179)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at java.lang.Thread.run(Thread.java:722)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) Caused by: java.lang.IllegalStateException: EntityManager is closed
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at org.hibernate.ejb.EntityManagerImpl.getSession(EntityManagerImpl.java:95)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:865)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at sun.reflect.GeneratedMethodAccessor115.invoke(Unknown Source)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at java.lang.reflect.Method.invoke(Method.java:601)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:365)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at $Proxy179.persist(Unknown Source)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at org.drools.persistence.jpa.JpaPersistenceContext.persist(JpaPersistenceContext.java:46)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.internalExecuteWorkItem(JPAWorkItemManager.java:43)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:107)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:126)
13:54:40,945 ERROR [stderr] (pool-28-thread-2) ... 47 more
My Spring Configuration for is:
<bean id="transactionManager"
class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManagerName" value="java:/TransactionManager"></property>
</bean>
<drools-spring:kbase id="kbase1">
<drools-spring:resources>
<drools-spring:resource type="BPMN2"
source="classpath:scripttask.bpmn2" />
<drools-spring:resource type="BPMN2"
source="classpath:process-async-interactions.bpmn" />
</drools-spring:resources>
</drools-spring:kbase>
<drools-spring:ksession id="ksession1" type="stateful"
kbase="kbase1">
<drools-spring:configuration>
<drools-spring:jpa-persistence>
<drools-spring:transaction-manager
ref="transactionManager" />
<drools-spring:entity-manager-factory
ref="entityManagerFactory" />
</drools-spring:jpa-persistence>
</drools-spring:configuration>
</drools-spring:ksession>
<bean id="wshtHandler" class="app.chameleon.core.taskmanagement.backend.utilities.jbpm.SelfRegisteringHT"
init-method="connect" destroy-method="dispose">
<constructor-arg ref="localTaskService"></constructor-arg>
<constructor-arg ref="ksession1"></constructor-arg>
</bean>
<bean id="localTaskService" class="org.jbpm.task.service.local.LocalTaskService"
destroy-method="dispose" scope="prototype">
<constructor-arg ref="taskService"></constructor-arg>
</bean>
<bean id="taskService" class="org.jbpm.task.service.TaskService">
<constructor-arg ref="entityManagerFactory"></constructor-arg>
<constructor-arg ref="systemEventListener"></constructor-arg>
</bean>
<bean id="systemEventListener" class="org.drools.SystemEventListenerFactory"
factory-method="getSystemEventListener" />
And my java function is:
@Autowired
StatefulKnowledgeSession ksession;
@Autowired
LocalTaskService taskService;
@Transactional(rollbackFor = Throwable.class)
public void runTest3(String user) throws Throwable {
Map<String, Object> params = new HashMap<String, Object>();
params.put("commentator", "thomas.setiabudi");
params.put("globalMessage", "aa");
ksession.startProcess("com.salaboy.process.AsyncInteractions", params);
}
Any Idea what may cause the error?