Protocol message contained an invalid tag while trying to Complete Task using drools 5.5.0.Final

1k views Asked by At

We have successfully upgrade Drools version "5.3.1.Final" to Drools "5.5.0.Final". Also "jbpm 5.2.0.Final" to "jbpm 5.4.0.Final".

Task created in Drools version "5.5.0.Final"(upgrade version) and while completing the task in same drools version, its working fine.

But the task created in Drools version "5.3.1.Final"(old version) and while completing the task in Drools version "5.5.0.Final"(upgrade version), the task not getting completed. Please refer below Exception and advice us.

Exception:-

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

There are 1 answers

1
Esteban Aliverti On

If I recall correctly, starting from 5.4 (or was it in 5.5?) Drools/jBPM introduced a new session serialization strategy based on Google's Protobuf. Before protobuf, they were using plain old Java's object serialization. When using persistence in jBPM 5.x, the entire session was serialized and persisted into the data base. When, for example, you completed a task, the session was deserialized and used to continue with the process execution. Given that you are trying to deserialize a Drools 5.3 session with Drools 5.5, I would say that what you are trying to achieve is not possible.

Unless there is some migration tool that I'm not aware of, I would suggest you to either start from the scratch with jBPM 5.5, or to continue using jBPM 5.3, in parallel, for your old process instances until you don't have any more of them.

Hope it helps,