2 Replies Latest reply on Apr 16, 2014 6:54 AM by Marco Rietveld

    java.lang.RuntimeException: Unable to load session snapshot

    Prabakaran Kamaraj Newbie

      Hi,

       

      We are using JBPM 5.2.0 Final version in our application, we are getting below exception. When below exception will occur. Is any one faced same issue?

       

      java.lang.RuntimeException: Unable to load session snapshot

          at org.drools.persistence.SessionMarshallingHelper.loadSnapshot(SessionMarshallingHelper.java:96)

          at org.drools.persistence.SingleSessionCommandService.initKsession(SingleSessionCommandService.java:238)

          at org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:191)

          at sun.reflect.GeneratedConstructorAccessor110.newInstance(Unknown Source)

          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

          at java.lang.reflect.Constructor.newInstance(Unknown Source)

          at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommandService(KnowledgeStoreServiceImpl.java:101)

          at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.loadStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:84)

          at org.drools.persistence.jpa.JPAKnowledgeService.loadStatefulKnowledgeSession(JPAKnowledgeService.java:131)

          at com.workflow.jbpm.service.KnowledgeSessionFactory.loadKnowledgeSession(KnowledgeSessionFactory.java:178)

          at com.workflow.jbpm.service.KnowledgeSessionFactory$$FastClassByCGLIB$$552fcfe.invoke(<generated>)

          at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)

          at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)

          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)

          at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)

          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

          at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)

          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

          at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)

          at com.workflow.jbpm.service.KnowledgeSessionFactory$$EnhancerByCGLIB$$4c31ea39.loadKnowledgeSession(<generated>)

          at com.workflow.jbpm.event.handler.CompleteTaskEventHandler.handleEvent(CompleteTaskEventHandler.java:91)

          at com.workflow.event.service.WorkflowEventService.processEvent(WorkflowEventService.java:51)

          at com.workflow.event.service.WorkflowEventService$$FastClassByCGLIB$$95456485.invoke(<generated>)

          at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)

          at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)

          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)

          at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)

          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

          at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)

          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

          at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)

          at com.workflow.event.service.WorkflowEventService$$EnhancerByCGLIB$$7d585ac6.processEvent(<generated>)

          at com.workflow.event.listener.WorkflowEventListener.processEvent(WorkflowEventListener.java:170)

          at com.workflow.event.listener.WorkflowEventListener.onMessage(WorkflowEventListener.java:139)

          at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:560)

          at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:498)

          at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467)

          at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)

          at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:243)

          at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058)

          at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:952)

          at org.springframework.scheduling.commonj.DelegatingWork.run(DelegatingWork.java:61)

          at de.myfoo.commonj.work.FooWorkItem.run(FooWorkItem.java:100)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

          at java.lang.Thread.run(Unknown Source)

      Caused by: java.lang.NullPointerException

          at org.drools.marshalling.impl.InputMarshaller.readSession(InputMarshaller.java:272)

          at org.drools.marshalling.impl.InputMarshaller.readSession(InputMarshaller.java:196)

          at org.drools.marshalling.impl.DefaultMarshaller.unmarshall(DefaultMarshaller.java:93)

          at org.drools.persistence.SessionMarshallingHelper.loadSnapshot(SessionMarshallingHelper.java:91)

          ... 45 more

       

      Thanks and Regards,

      Praba

        • 1. Re: java.lang.RuntimeException: Unable to load session snapshot
          Prabakaran Kamaraj Newbie

          Hi,

           

          We did debugging above issue and found the following

           

          We found that in one of our BPMN(xxx.BPMN2) Process  decision point constraint, we selected Type as “rule” and Dialect as “mvel”.

          While  loading knowledge base, found that Rule added like RuleFlow-Split-xxx-2-6-DROOLS_DEFAULT.

          If we  start any other BPMN(yyy.BPMN2) process with new session, after process started session got persisted like “[EvalConditionNode: cond=org.drools.bpmn2.Rule_RuleFlow_Split_xxx_2_6_DROOLS_DEFAULTEval0Invoker@36758e]” .

          After restating server If we try to complete task which is created before server restart, we are getting error from below part of code in “org.drools.marshalling.impl. InputMarshaller”,

          LeftTupleSink  is become null from sink map, because after restart sink Map having different id as key.

           

          while (context.stream.readShort() == PersisterEnums.LEFT_TUPLE) {

                      LeftTupleSink sink = (LeftTupleSink) context.sinks.get(context.stream.readInt());

                      LeftTuple leftTuple = sink.createLeftTuple( handle, sink,  true );

                      readLeftTuple( leftTuple, context );

             }

           

           

          Why Rule_RuleFlow_Split_xxx_2_6_DROOLS_DEFAULTE is added to other process(yyy.BPMN2) session?

           

          Why sink Map loaded with different key after server restart?

           

          Thanks and Regards,

          Praba

          • 2. Re: java.lang.RuntimeException: Unable to load session snapshot
            Marco Rietveld Novice

            This looks like a minor problem with the Drools rule you're using. I would post this question to the rules-users list: they may be able to help you there.

             

            Info about the rules-users list can be found here:

            http://www.jboss.org/drools/lists.html