我正在使用jBPM5,并且我已将Bitronix事务管理器(BTM)配置为jBPM进程持久性单元使用的事务管理器。
过去两周内一切正常,但突然间它开始失败并出现以下异常,这导致我重新启动应用程序服务器。重新启动后,一切都按预期正常工作。
异常Stacktrace:
com.xxx.jbpm.workflow.exception.WorkflowException: Could not commit session or rollback
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
at com.xxx.platform.eventpublisher.xxxEventPublisher.publish(xxxEventPublisher.java:16)
at com.xxx.xxx.wsserver.impl.dlp.DLPCheckTask.publish(DLPCheckTask.java:97)
at com.xxx.xxx.wsserver.impl.dlp.DLPCheckTask.run(DLPCheckTask.java:56)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.RuntimeException: Could not commit session or rollback
at org.drools.persistence.SingleSessionCommandService.rollbackTransaction(SingleSessionCommandService.java:406)
at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:381)
at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.startProcessInstance(CommandBasedStatefulKnowledgeSession.java:237)
at com.xxx.jbpm.workflow.services.WorkflowServiceHandler.startWorkflow(WorkflowServiceHandler.java:71)
at com.xxx.jbpm.workflow.impl.WorkflowManagerImpl.startWorkflow(WorkflowManagerImpl.java:46)
... 12 more
Caused by: java.lang.RuntimeException: Unable to rollback transaction
at org.drools.persistence.jta.JtaTransactionManager.rollback(JtaTransactionManager.java:197)
at org.drools.persistence.SingleSessionCommandService.rollbackTransaction(SingleSessionCommandService.java:402)
... 16 more
Caused by: java.lang.IllegalStateException: no transaction started on this thread
at bitronix.tm.BitronixTransactionManager.rollback(BitronixTransactionManager.java:150)
at org.drools.persistence.jta.JtaTransactionManager.rollback(JtaTransactionManager.java:191)
... 17 more
我们正在启动大量的事务/工作流并使用jbpm库版本的5.5.0.final of jbpm-human-task-core,jbpm-bpmn2,jbpm-persistence-jpa。
有人可以帮我指出正确的方向吗?
非常感谢, Mayank
答案 0 :(得分:0)
在回滚事务期间出现问题。但是,回滚本身是由另一个问题引起的(可能是与启动事务相关的问题)。但是,此处未显示该例外情况。在此之前是否记录了任何异常?如果没有,您是否可以尝试调试SingleSessionCommandService.rollbackTransaction操作,以便查看触发回滚的异常?
有关您正在使用哪个版本的一些帮助会有所帮助,例如在最新版本中,应该记录回滚的原因: https://github.com/droolsjbpm/drools/blob/master/drools-persistence-jpa/src/main/java/org/drools/persistence/SingleSessionCommandService.java#L364