0

我在 jBPM 6.2.0 中运行 Deadline 任务时关闭了 EntityManager

这是日志跟踪。我在我的代码中没有看到我关闭实体管理工厂的任何地方。

            java.lang.IllegalStateException: EntityManager is closednull
at org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:1181)null
at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.doJoinTransaction(ExtendedEntityManagerCreator.java:360)null
at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:327)null
at com.sun.proxy.$Proxy142.joinTransaction(Unknown Source)null
at org.drools.persistence.jpa.JpaPersistenceContext.joinTransaction(JpaPersistenceContext.java:87)null
at org.drools.persistence.SingleSessionCommandService$TransactionInterceptor.execute(SingleSessionCommandService.java:519)null
at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)null
at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:73)null
at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)null
at org.drools.persistence.jta.TransactionLockInterceptor.execute(TransactionLockInterceptor.java:67)null
at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:358)null
at org.jbpm.process.core.timer.impl.GlobalTimerService$DisposableCommandService.execute(GlobalTimerService.java:302)null
at org.jbpm.persistence.timer.GlobalJpaTimerJobInstance.call(GlobalJpaTimerJobInstance.java:77)null
at org.jbpm.persistence.timer.GlobalJpaTimerJobInstance.call(GlobalJpaTimerJobInstance.java:47)null
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)null
at java.util.concurrent.FutureTask.run(FutureTask.java:166)null
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)null
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)null
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)null
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)null
at java.lang.Thread.run(Thread.java:781)null
4

1 回答 1

1

没有问题我得到了这个问题的答案。我们没有初始化持久性 xml。以下语句的顺序很重要,我们在那里搞砸了。

<persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/jbpmDS</jta-data-source>  
于 2015-10-14T12:19:52.017 回答