hansi007 [
https://community.jboss.org/people/hansi007] created the discussion
"Marshalling of a JBPM session"
To view the discussion, visit:
https://community.jboss.org/message/735387#735387
--------------------------------------------------------------
I want to marshall my jbpm session. Therefore i used the tutorial
http://packtlib.packtpub.com/library/9781849511964/ch02lvl1sec02
http://packtlib.packtpub.com/library/9781849511964/ch02lvl1sec02
My code to marshall:
KnowledgeBase kbase = ...
StatefulKnowledgeSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession(
kbase, null, env );
...
ByteArrayOutputStream baos = new ByteArrayOutputStream();
Marshaller marshaller = MarshallerFactory.newMarshaller(kbase);
File file = new
File("ksession_"+sessionId+".info");
FileOutputStream foStream;
try {
foStream = new FileOutputStream(file);
marshaller.marshall(baos, ksession);
baos.writeTo(foStream);
baos.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
If this code is executed the following exception occurs (in the line
"marshaller.marshall(baos, ksession);"):
java.lang.ClassCastException: org.drools.command.impl.CommandBasedStatefulKnowledgeSession
cannot be cast to org.drools.impl.StatefulKnowledgeSessionImpl
at
org.drools.marshalling.impl.DefaultMarshaller.marshall(DefaultMarshaller.java:134)
at
org.drools.marshalling.impl.DefaultMarshaller.marshall(DefaultMarshaller.java:126)
...
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/735387#735387]
Start a new discussion in jBPM at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]