Hi Michael,<br><br>Attached a eclipse project with 2 sample apps showing my problem.<br><br>There are 2 main classes, 1 for CEP and STREAM enviroment and other without them.<br><br>The extrange behavior is that the engine keeps the Working Memory correctly and does the changes correctly in the nonTemporal enviroment (ksession.insert()) but at the Temporal enviroment (ksession.getWorkingMemoryEntryPoint(&quot;MyEntryPoint&quot;).insert(fact)) keeps the WM and doesnt change the RuleBase.<br>
<br>Both main classes have 1 parameter setting the drl path: <br>file:src/main/resources/cepRule.drl<br>file:src/main/resources/nonCepRule.drl<br><br>Try execute both enviroments, do changes inside the DRLs and see if the kagent updates the KSession correctly.<br>
<br>Thanks,<br><br>Nestor<br><br>PD: Actually I use both enviroments using the Guvnor PKG repository, in the post I wrote the error thrown if I use Guvnor instead DRL files but is the same problem as the attached project, the ksession doesnt refresh the KnowledgeBase in my Temporal enviroment.<br>
<br><div class="gmail_quote">2009/9/1 Michael Neale <span dir="ltr">&lt;<a href="mailto:michael.neale@gmail.com">michael.neale@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Nestor - that is a tough one.<br>
<br>
I have a suspicion this is related to another issue I have seen with<br>
deserliasation of rulebases when the MVEL JIT kicks in... (from that<br>
strack trace it isn&#39;t getting the TypeDeclaration back...) - its a<br>
stretch, but might be related to:<br>
<a href="https://jira.jboss.org/jira/browse/JBRULES-2253" target="_blank">https://jira.jboss.org/jira/browse/JBRULES-2253</a><br>
<br>
As there are a few moving parts, if you could create a unit test that<br>
starts up a agent and shows this behaviour, that would be appreciated<br>
(confused about the interaction with entry points).<br>
<br>
Thanks,<br>
<br>
Michael.<br>
<div><div></div><div class="h5"><br>
<br>
<br>
On Mon, Aug 31, 2009 at 8:38 PM, nestabur&lt;<a href="mailto:nestabur@gmail.com">nestabur@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; Any suggestions? I have my project in stand-by due to that problem ...<br>
&gt;<br>
&gt; Nestor<br>
&gt;<br>
&gt;<br>
&gt; nestabur wrote:<br>
&gt;&gt;<br>
&gt;&gt; Does anyone tried to use the knowledgeAgent with statefulSessions?<br>
&gt;&gt;<br>
&gt;&gt; I&#39;ve tried to configure my rule engine obtaining unexpected behaviour.<br>
&gt;&gt;<br>
&gt;&gt; I configure my statefulSession as follows:<br>
&gt;&gt;<br>
&gt;&gt; wm = (ReteooStatefulSession) ((KnowledgeBaseImpl) kagent<br>
&gt;&gt;<br>
&gt;&gt; .getKnowledgeBase()).ruleBase.newStatefulSession(<br>
&gt;&gt;                                 (SessionConfiguration) sessionConf, env);<br>
&gt;&gt; ksession = new StatefulKnowledgeSessionImpl(wm,<br>
&gt;&gt; kagent.getKnowledgeBase());<br>
&gt;&gt;<br>
&gt;&gt; And after updating the KnowledgeBase in the agent I update my ksession:<br>
&gt;&gt;<br>
&gt;&gt; wm.setRuleBase((InternalRuleBase) ((KnowledgeBaseImpl) kagent<br>
&gt;&gt;<br>
&gt;&gt; .getKnowledgeBase()).ruleBase);<br>
&gt;&gt; ksession = new StatefulKnowledgeSessionImpl(wm,<br>
&gt;&gt; kagent.getKnowledgeBase());<br>
&gt;&gt;<br>
&gt;&gt; Without using entry-points this approach works as expected, but using them<br>
&gt;&gt; it fails after the first update throwing the error:<br>
&gt;&gt;<br>
&gt;&gt; Exception while processing message: java.lang.NullPointerException<br>
&gt;&gt; java.lang.NullPointerException<br>
&gt;&gt;         at<br>
&gt;&gt; org.drools.reteoo.ReteooFactHandleFactory.newFactHandle(ReteooFactHandleFactory.java:54)<br>
&gt;&gt;         at<br>
&gt;&gt; org.drools.common.AbstractFactHandleFactory.newFactHandle(AbstractFactHandleFactory.java:79)<br>
&gt;&gt;         at<br>
&gt;&gt; org.drools.common.AbstractFactHandleFactory.newFactHandle(AbstractFactHandleFactory.java:66)<br>
&gt;&gt;         at<br>
&gt;&gt; org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:109)<br>
&gt;&gt;         at<br>
&gt;&gt; org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:80)<br>
&gt;&gt;         at<br>
&gt;&gt; org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:28)<br>
&gt;&gt;<br>
&gt;&gt; Browsing the drools core code I found the line that was throwing the<br>
&gt;&gt; exception and tried to get the same result by implementing:<br>
&gt;&gt;<br>
&gt;&gt; if (!((InternalRuleBase) ((KnowledgeBaseImpl)<br>
&gt;&gt; ksession.getKnowledgeBase()).ruleBase)<br>
&gt;&gt;                                 .getTypeDeclaration(fact.getClass()) ==<br>
&gt;&gt; null)<br>
&gt;&gt;         <a href="http://log.info" target="_blank">log.info</a> (((InternalRuleBase) ((KnowledgeBaseImpl)<br>
&gt;&gt; ksession.getKnowledgeBase()).ruleBase)<br>
&gt;&gt;<br>
&gt;&gt; .getTypeDeclaration(fact.getClass()).getTimestampExtractor().toString());<br>
&gt;&gt;<br>
&gt;&gt; after updating my ksession. The result was the same, again the same<br>
&gt;&gt; exception thrown but my logger wrote:<br>
&gt;&gt; 18:01:50,232 INFO [ClassFieldExtractor class=MyPackage.MyFact<br>
&gt;&gt; field=myTimestampField]<br>
&gt;&gt;<br>
&gt;&gt; So I dont know why the core is throwing that exception, is that<br>
&gt;&gt; implementation correct?, any ideas?<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Thanks,<br>
&gt;&gt;<br>
&gt;&gt; Nestor<br>
&gt;&gt;<br>
&gt;<br>
&gt; --<br>
&gt; View this message in context: <a href="http://www.nabble.com/Drools-Core-Error--tp25188219p25221364.html" target="_blank">http://www.nabble.com/Drools-Core-Error--tp25188219p25221364.html</a><br>
&gt; Sent from the drools - dev mailing list archive at Nabble.com.<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; rules-dev mailing list<br>
&gt; <a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
&gt;<br>
<br>
<br>
<br>
</div></div><font color="#888888">--<br>
Michael D Neale<br>
home: <a href="http://www.michaelneale.net" target="_blank">www.michaelneale.net</a><br>
blog: <a href="http://michaelneale.blogspot.com" target="_blank">michaelneale.blogspot.com</a><br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
</div></div></blockquote></div><br>