0 Replies Latest reply on Jul 17, 2013 6:56 AM by abadr

    Unable to get Session Snapshot

    abadr Newbie

      Hi,

       

      I am new to JBPM and I am trying to build a stateful workflow process (stateless is working just fine) with two Email Tasks and one signal event (see attached file that includes the Java file and the bpmn file. When I try to start the process and when it reaches the wait state and try to save the current session, I get the following exceptions thrown (I tried to google this problem but with no success so far):

       

      0    17/07 12:42:06,152[main] ERROR drools.persistence.SingleSessionCommandService.rollbackTransaction  - Could not commit session

      java.lang.RuntimeException: Unable to commit transaction

           at org.drools.persistence.jta.JtaTransactionManager.commit(JtaTransactionManager.java:182)

           at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:376)

           at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.startProcessInstance(CommandBasedStatefulKnowledgeSession.java:237)

           at com.sample.UploadDocumentWorkflowProcessMain.main(UploadDocumentWorkflowProcessMain.java:79)

      Caused by: javax.persistence.PersistenceException: java.lang.RuntimeException: Unable to get session snapshot

           at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:516)

           at bitronix.tm.BitronixTransaction.fireBeforeCompletionEvent(BitronixTransaction.java:478)

           at bitronix.tm.BitronixTransaction.commit(BitronixTransaction.java:193)

           at bitronix.tm.BitronixTransactionManager.commit(BitronixTransactionManager.java:120)

           at org.drools.persistence.jta.JtaTransactionManager.commit(JtaTransactionManager.java:179)

           ... 3 more

      Caused by: java.lang.RuntimeException: Unable to get session snapshot

           at org.drools.persistence.SessionMarshallingHelper.getSnapshot(SessionMarshallingHelper.java:75)

           at org.drools.persistence.info.SessionInfo.update(SessionInfo.java:85)

           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

           at java.lang.reflect.Method.invoke(Method.java:606)

           at org.hibernate.ejb.event.BeanCallback.invoke(BeanCallback.java:23)

           at org.hibernate.ejb.event.EntityCallbackHandler.callback(EntityCallbackHandler.java:80)

           at org.hibernate.ejb.event.EntityCallbackHandler.preUpdate(EntityCallbackHandler.java:65)

           at org.hibernate.ejb.event.EJB3FlushEntityEventListener.invokeInterceptor(EJB3FlushEntityEventListener.java:41)

           at org.hibernate.event.def.DefaultFlushEntityEventListener.handleInterception(DefaultFlushEntityEventListener.java:330)

           at org.hibernate.event.def.DefaultFlushEntityEventListener.scheduleUpdate(DefaultFlushEntityEventListener.java:270)

           at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:151)

           at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:219)

           at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:99)

           at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:49)

           at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)

           at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:366)

           at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:504)

           ... 7 more

      Caused by: java.io.NotSerializableException: org.drools.impl.StatefulKnowledgeSessionImpl

           at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1181)

           at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1541)

           at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1506)

           at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1429)

           at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1175)

           at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347)

           at java.util.ArrayList.writeObject(ArrayList.java:710)

           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

           at java.lang.reflect.Method.invoke(Method.java:606)

           at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:988)

           at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)

           at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1429)

           at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1175)

           at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347)

           at org.drools.marshalling.impl.SerializablePlaceholderResolverStrategy$SerializablePlaceholderStrategyContext.write(SerializablePlaceholderResolverStrategy.java:97)

           at org.drools.marshalling.impl.PersisterHelper.writeStrategiesIndex(PersisterHelper.java:209)

           at org.drools.marshalling.impl.PersisterHelper.writeToStreamWithHeader(PersisterHelper.java:189)

           at org.drools.marshalling.impl.ProtobufOutputMarshaller.writeSession(ProtobufOutputMarshaller.java:101)

           at org.drools.marshalling.impl.ProtobufMarshaller.marshall(ProtobufMarshaller.java:169)

           at org.drools.marshalling.impl.ProtobufMarshaller.marshall(ProtobufMarshaller.java:151)

           at org.drools.persistence.SessionMarshallingHelper.getSnapshot(SessionMarshallingHelper.java:72)

           ... 25 more

      java.lang.RuntimeException: Unable to commit transaction

           at org.drools.persistence.jta.JtaTransactionManager.commit(JtaTransactionManager.java:182)

           at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:376)

           at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.startProcessInstance(CommandBasedStatefulKnowledgeSession.java:237)

           at com.sample.UploadDocumentWorkflowProcessMain.main(UploadDocumentWorkflowProcessMain.java:79)

      Caused by: javax.persistence.PersistenceException: java.lang.RuntimeException: Unable to get session snapshot

           at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:516)

           at bitronix.tm.BitronixTransaction.fireBeforeCompletionEvent(BitronixTransaction.java:478)

           at bitronix.tm.BitronixTransaction.commit(BitronixTransaction.java:193)

           at bitronix.tm.BitronixTransactionManager.commit(BitronixTransactionManager.java:120)

           at org.drools.persistence.jta.JtaTransactionManager.commit(JtaTransactionManager.java:179)

           ... 3 more

       

      My Persistence.xml is as follows: