使用drools 5.5.0.Final尝试完成任务时,协议消息包含无效标记

时间:2015-06-24 12:21:56

标签: task protocol-buffers drools protobuf-net jbpm

我们已成功升级Drools版本" 5.3.1.Final" Drools" 5.5.0.Final"。另外" jbpm 5.2.0.Final" to" jbpm 5.4.0.Final"。

在Drools版本" 5.5.0.Final"(升级版本)中创建的任务,在完成相同drools版本的任务时,其工作正常。

但任务是在Drools版本" 5.3.1.Final"(旧版本)中创建的,同时在Drools版本中完成任务" 5.5.0.Final"(升级版本) ,任务没有完成。请参阅下面的例外情况并提出建议。

异常: -

19:06:50,728 SEVERE [org.drools.persistence.SingleSessionCommandService] (http--localhost-8080-7) Could not commit session: java.lang.RuntimeException: Unable to load session snapshot
  at org.drools.persistence.SessionMarshallingHelper.loadSnapshot(SessionMarshallingHelper.java:96) [drools-persistence-jpa-5.5.0.Final.jar:]
  at org.drools.persistence.SingleSessionCommandService.initKsession(SingleSessionCommandService.java:253) [drools-persistence-jpa-5.5.0.Final.jar:]
  at org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:195) [drools-persistence-jpa-5.5.0.Final.jar:]
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [:1.7.0_67]
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [:1.7.0_67]
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [:1.7.0_67]
  at java.lang.reflect.Constructor.newInstance(Constructor.java:526) [:1.7.0_67]
  at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommandService(KnowledgeStoreServiceImpl.java:100) [drools-persistence-jpa-5.5.0.Final.jar:]
  at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.loadStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:83) [drools-persistence-jpa-5.5.0.Final.jar:]
  at org.drools.persistence.jpa.JPAKnowledgeService.loadStatefulKnowledgeSession(JPAKnowledgeService.java:131) [knowledge-api-5.5.0.Final.jar:]
  at com.tnq.workflow.engine.JbpmAPIUtil.loadKnowledgeSession(JbpmAPIUtil.java:187) [NimbleAPICore-2.0.jar:]
  at com.tnq.workflow.engine.JbpmAPIUtil.loadKnowledgeSession(JbpmAPIUtil.java:135) [NimbleAPICore-2.0.jar:]
  at com.tnq.workflow.engine.BaseTaskManagement.registerEvents(BaseTaskManagement.java:381) [NimbleAPICore-2.0.jar:]
  at com.tnq.workflow.engine.BaseTaskManagement.completeTask(BaseTaskManagement.java:431) [NimbleAPICore-2.0.jar:]
  at com.tnq.workflow.engine.TaskManagementImpl.completeTask(TaskManagementImpl.java:146) [classes:]
  at com.tnq.workflow.engine.TaskManagementImpl$$FastClassByCGLIB$$ade224e9.invoke(<generated>) [cglib-2.2.jar:]
  at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191) [cglib-2.2.jar:]
  at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689) [spring-aop-3.1.1.RELEASE.jar:]
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) [spring-aop-3.1.1.RELEASE.jar:]
  at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90) [spring-aop-3.1.1.RELEASE.jar:]
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) [spring-aop-3.1.1.RELEASE.jar:]
  at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622) [spring-aop-3.1.1.RELEASE.jar:]
  at com.tnq.workflow.engine.TaskManagementImpl$$EnhancerByCGLIB$$d521e7f9.completeTask(<generated>) [cglib-2.2.jar:]
  at com.tnq.workflow.services.BaseTaskService.completeTask(BaseTaskService.java:267) [NimbleAPICore-2.0.jar:]
  at com.tnq.workflow.services.TaskServiceImpl.completeTask(TaskServiceImpl.java:428) [classes:]
  at com.tnq.workflow.services.TaskServiceImpl$$FastClassByCGLIB$$89eef3ab.invoke(<generated>) [cglib-2.2.jar:]
  at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191) [cglib-2.2.jar:]
  at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689) [spring-aop-3.1.1.RELEASE.jar:]
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) [spring-aop-3.1.1.RELEASE.jar:]
  at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80) [spring-aop-3.1.1.RELEASE.jar:]
  at com.tnq.aspects.TaskNotificationAspect.notifyCompleteTask(TaskNotificationAspect.java:133) [classes:]
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.7.0_67]
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [:1.7.0_67]
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [:1.7.0_67]
  at java.lang.reflect.Method.invoke(Method.java:606) [:1.7.0_67]
  at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621) [spring-aop-3.1.1.RELEASE.jar:]
  at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610) [spring-aop-3.1.1.RELEASE.jar:]
  at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65) [spring-aop-3.1.1.RELEASE.jar:]
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) [spring-aop-3.1.1.RELEASE.jar:]
  at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) [spring-tx-3.1.1.RELEASE.jar:]
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) [spring-aop-3.1.1.RELEASE.jar:]
  at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90) [spring-aop-3.1.1.RELEASE.jar:]
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) [spring-aop-3.1.1.RELEASE.jar:]
  at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622) [spring-aop-3.1.1.RELEASE.jar:]
  at com.tnq.workflow.services.TaskServiceImpl$$EnhancerByCGLIB$$4b9ff596.completeTask(<generated>) [cglib-2.2.jar:]
  at com.tnq.workflow.web.controllers.TasksController.completeTask(TasksController.java:114) [classes:]
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.7.0_67]
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [:1.7.0_67]
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [:1.7.0_67]
  at java.lang.reflect.Method.invoke(Method.java:606) [:1.7.0_67]
  at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213) [spring-web-3.1.1.RELEASE.jar:]
  at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126) [spring-web-3.1.1.RELEASE.jar:]
  at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96) [spring-webmvc-3.1.1.RELEASE.jar:]
  at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617) [spring-webmvc-3.1.1.RELEASE.jar:]
  at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578) [spring-webmvc-3.1.1.RELEASE.jar:]
  at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80) [spring-webmvc-3.1.1.RELEASE.jar:]
  at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923) [spring-webmvc-3.1.1.RELEASE.jar:]
  at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) [spring-webmvc-3.1.1.RELEASE.jar:]
  at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) [spring-webmvc-3.1.1.RELEASE.jar:]
  at org.springframework.web.servlet.FrameworkServlet.doPut(FrameworkServlet.java:800) [spring-webmvc-3.1.1.RELEASE.jar:]
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:757) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
  at com.thetransactioncompany.cors.CORSFilter.doFilter(Unknown Source) [cors-filter-1.2.1.jar:]
  at com.thetransactioncompany.cors.CORSFilter.doFilter(Unknown Source) [cors-filter-1.2.1.jar:]
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
  at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) [spring-orm-3.1.1.RELEASE.jar:]
  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) [spring-web-3.1.1.RELEASE.jar:]
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
  at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:139) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
  at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:952) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
  at java.lang.Thread.run(Thread.java:745) [:1.7.0_67]
Caused by: com.google.protobuf.InvalidProtocolBufferException: Protocol message contained an invalid tag (zero).
  at com.google.protobuf.InvalidProtocolBufferException.invalidTag(InvalidProtocolBufferException.java:68) [protobuf-java-2.4.1.jar:]
  at com.google.protobuf.CodedInputStream.readTag(CodedInputStream.java:108) [protobuf-java-2.4.1.jar:]
  at org.drools.marshalling.impl.ProtobufMessages$Header$Builder.mergeFrom(ProtobufMessages.java:967) [drools-core-5.5.0.Final.jar:]
  at org.drools.marshalling.impl.ProtobufMessages$Header$Builder.mergeFrom(ProtobufMessages.java:773) [drools-core-5.5.0.Final.jar:]
  at com.google.protobuf.AbstractMessageLite$Builder.mergeFrom(AbstractMessageLite.java:212) [protobuf-java-2.4.1.jar:]
  at com.google.protobuf.AbstractMessage$Builder.mergeFrom(AbstractMessage.java:746) [protobuf-java-2.4.1.jar:]
  at org.drools.marshalling.impl.ProtobufMessages$Header.parseFrom(ProtobufMessages.java:724) [drools-core-5.5.0.Final.jar:]
  at org.drools.marshalling.impl.PersisterHelper.readFromStreamWithHeader(PersisterHelper.java:234) [drools-core-5.5.0.Final.jar:]
  at org.drools.marshalling.impl.ProtobufInputMarshaller.loadAndParseSession(ProtobufInputMarshaller.java:217) [drools-core-5.5.0.Final.jar:]
  at org.drools.marshalling.impl.ProtobufInputMarshaller.readSession(ProtobufInputMarshaller.java:149) [drools-core-5.5.0.Final.jar:]
  at org.drools.marshalling.impl.ProtobufMarshaller.unmarshall(ProtobufMarshaller.java:117) [drools-core-5.5.0.Final.jar:]
  at org.drools.persistence.SessionMarshallingHelper.loadSnapshot(SessionMarshallingHelper.java:91) [drools-persistence-jpa-5.5.0.Final.jar

1 个答案:

答案 0 :(得分:1)

如果我没记错,从5.4开始(或者是5.5?)Drools / jBPM引入了基于Google's Protobuf的新会话序列化策略。在protobuf之前,他们使用普通的旧Java对象序列化。 在jBPM 5.x中使用持久性时,整个会话被序列化并持久保存到数据库中。例如,当您完成任务时,会话被反序列化并用于继续执行流程。 鉴于您正在尝试使用Drools 5.5反序列化Drools 5.3会话,我会说您想要实现的目标是不可能的。

除非有一些我不知道的迁移工具,否则我建议您从头开始使用jBPM 5.5,或者继续使用jBPM 5.3并行地为您的旧流程实例使用,直到您不再拥有它们。

希望它有所帮助,