<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hey Demian,&nbsp;</div><div><br></div><div>thank you! This might actually be related. But how do I get the reference to these Operators to (re)set them?</div><div><br></div><div>This is my unmarshalling code (pretty simple and basic..):</div><div><br></div><div><div style="margin: 0px; font-size: 12px; font-family: Monaco; ">ByteArrayInputStream bais = <span style="color: #931a68">new</span> ByteArrayInputStream(<span style="color: #0326cc">serializedKnowledgeBase</span>);</div><div style="margin: 0px; font-size: 12px; font-family: Monaco; ">ObjectInputStream ois = <span style="color: #931a68">new</span> ObjectInputStream(bais);</div><div style="margin: 0px; font-size: 12px; font-family: Monaco; ">kbase = (KnowledgeBase)ois.readObject();</div><p style="margin: 0px; font-size: 12px; font-family: Monaco; min-height: 16px; "><span class="Apple-tab-span" style="white-space:pre">                        </span></p><div style="margin: 0px; font-size: 12px; font-family: Monaco; ">Marshaller marshaller = MarshallerFactory.newMarshaller(kbase);</div><div style="margin: 0px; font-size: 12px; font-family: Monaco; ">ByteArrayInputStream bais2 = <span style="color: #931a68">new</span> ByteArrayInputStream(<span style="color: #0326cc">serializedKnowledgeSession</span>);</div><div style="margin: 0px; font-size: 12px; font-family: Monaco; "><span style="color: #0326cc">knowledgeSession</span> = marshaller.unmarshall(bais2);</div></div><div><br></div><div>Also:&nbsp;Is this going to be fixed in 5.6.0 ? (@Mark Proctor?)</div><div><br></div><div>- Alex</div><div><br></div><br><div><div>On 11.10.2013, at 16:09, Demian Calcaprina &lt;<a href="mailto:calcacuervo@gmail.com">calcacuervo@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div>Hey Alexander,&nbsp;</div><div><br></div>Would this be related to this?<div><br></div><div><a href="https://issues.jboss.org/browse/DROOLS-243">https://issues.jboss.org/browse/DROOLS-243</a><br></div><div><br>
</div><div>If it is this one, you can do something like this as a workaround before constructing the KBase:</div><div><br></div><div><span style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;line-height:20px">Operator op = BeforeEvaluatorDefinition.BEFORE;</span><br style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;line-height:20px">
<span style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;line-height:20px">Operator op = AfterEvaluatorDefinition.AFTER;</span><br></div><div><span style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;line-height:20px"><br>
</span></div><div><span style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;line-height:20px">This will cause the evaluation definition to be put in &nbsp;memory.</span></div><div><span style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;line-height:20px"><br>
</span></div><div><span style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;line-height:20px">Hope this helps!</span></div><div><span style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;line-height:20px"><br>
</span></div><div><span style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;line-height:20px">Demian</span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Oct 11, 2013 at 9:21 AM, Alexander Wolf <span dir="ltr">&lt;<a href="mailto:mail@alexander-wolf.net" target="_blank">mail@alexander-wolf.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">[Drools 5.5.0 Final]<br>
<br>
I wrote a webserver that keeps StatefulKnowledgeSessions running in Stream mode. When the server is stopped, the sessions are serialized and stored in a database. When the server is restarted, the existing sessions are restored / deserialized.<br>

<br>
Some time after recreating the session and inserting some events I get the following exception:<br>
<br>
java.lang.NullPointerException: null<br>
at org.drools.base.evaluators.AfterEvaluatorDefinition$AfterEvaluator.evaluateCachedLeft(AfterEvaluatorDefinition.java:351)<br>
...<br>
<br>
Apparently the exception seems to be related to a rule that uses temporal reasoning.<br>
After getting it once, the session seems to be corrupt -&gt; from now on every time I call ksession.insert(event) the same exception occurs.<br>
When I serialize the session and attempt to deserialize it, I get a long stack trace --&gt; I can not deserialize it anymore. (as apparently it is corrupted).<br>
When I run the server with the same events/sessions without stopping (serialization/deserialization) the exception does not occur)<br>
<br>
Can I do anything to prevent this behaviour? I thought maybe the "after" timer/trigger is somehow still active when I serialize the ksession.<br>
I tried ksession.halt() before serialization, but with no effect.<br>
<br>
Any ideas?<br>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote></div><br></div>
_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/rules-users</blockquote></div><br></body></html>