Hi Drools Team,
I am trying out new Serialization technique introduced in Drools 5.0 using "org.drools.marshalling.DefaultMarshaller".
The use case I am trying, is:
Create a Stateful session.
Then Serialize that.
Try to load the the serialized session back.
Loading of serialized session is working good if, I try that in same java program & same object of DefaultMarshaller is used during serialization & de serialization of the Stateful session.
But, when I tried a different instance of DefaultMarshaller to read back the saved session, that is not working anymore. I am getting a exception :
java.lang.NullPointerException
        at org.drools.common.DefaultFactHandle.<init>(DefaultFactHandle.java:78)
        at org.drools.marshalling.InputMarshaller.readFactHandle(InputMarshaller.java:331)
        at org.drools.marshalling.InputMarshaller.readFactHandles(InputMarshaller.java:277)
        at org.drools.marshalling.InputMarshaller.readSession(InputMarshaller.java:179)
        at org.drools.marshalling.DefaultMarshaller.read(DefaultMarshaller.java:58)
        at org.drools.marshalling.DefaultMarshaller.read(DefaultMarshaller.java:15)
        at org.drools.reteoo.ReteooRuleBase.readStatefulSession(ReteooRuleBase.java:277)
        at org.drools.common.AbstractRuleBase.readStatefulSession(AbstractRuleBase.java:321)
        at com.sample.test.NewMarshallingTest.testSerializationInFile_1(NewMarshallingTest.java:79)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
With Drools 4.0.7 ... I can serialize a Stateful session & at later point of time I can deserialize that back. For our usecase, the feature is very critical.
Does Drools 5.0 support that ? DefaultMarshaller is not serializable. So once a Stateful session is serialized. At Later point of time, I am not able to read that back.
I have attached my test files.
Best Regards!
Siddhartha
<a href="http://www.nabble.com/file/p20309577/TestFiles.zip" target="_top">TestFiles.zip</a>
<br><hr align="left" width="300">
View this message in context: <a href="http://www.nabble.com/Serialization-in-Drools-5.0-M2-tp20309577p20309577.html">Serialization in Drools 5.0 M2</a><br>
Sent from the <a href="http://www.nabble.com/drools---user-f11823.html">drools - user mailing list archive</a> at Nabble.com.<br>