我已經在Tomcat上使用Bitronix作爲使用Spring的事務管理器,將jbpm 5.4設置爲web應用程序。當我嘗試使用自定義類對象作爲signalEvent
JBPM 5.4使用自定義類對象作爲信號事件中的參數
ErrorNode en = new ErrorNode(e.getMessage(), "abc", workItem.getId());
ksession.getProcessInstance(workItem.getProcessInstanceId())
.signalEvent("error", en);
我得到下面的異常事件參數信號事件。如果將ErrorNode
對象替換爲僅包含字符串或其他基本類型的String
甚至HashMap
,則此錯誤消失。任何洞察爲什麼會發生這種情況會有所幫助。使用自定義對象時是否缺少配置?我已經聲明signal事件的VariableName屬性包含此errorNode對象,該對象被聲明爲相應類型的流程變量。
編輯:如果你是一個jBPM開發者,你可能想看看這個錯誤,不給的跡象表明,它實際上是在編程方面,導致該 錯誤 序列化錯誤。實際的異常不會傳播到輸出。
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.startProcess(CommandBasedStatefulKnowledgeSession.java:223)
at services.StartProcess.h2startProcess(StartProcess.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:920)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:816)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:801)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:931)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
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)
Caused by: java.lang.RuntimeException: Unable to rollback transaction
at org.drools.container.spring.beans.persistence.DroolsSpringTransactionManager.rollback(DroolsSpringTransactionManager.java:85)
at org.drools.persistence.SingleSessionCommandService.rollbackTransaction(SingleSessionCommandService.java:402)
... 35 more
Caused by: org.springframework.transaction.IllegalTransactionStateException: Transaction is already completed - do not call commit or rollback more than once per transaction
at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:818)
at org.drools.container.spring.beans.persistence.DroolsSpringTransactionManager.rollback(DroolsSpringTransactionManager.java:79)
... 36 more