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("MyEntryPoint").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"><<a href="mailto:michael.neale@gmail.com">michael.neale@gmail.com</a>></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'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<<a href="mailto:nestabur@gmail.com">nestabur@gmail.com</a>> wrote:<br>
><br>
> Any suggestions? I have my project in stand-by due to that problem ...<br>
><br>
> Nestor<br>
><br>
><br>
> nestabur wrote:<br>
>><br>
>> Does anyone tried to use the knowledgeAgent with statefulSessions?<br>
>><br>
>> I've tried to configure my rule engine obtaining unexpected behaviour.<br>
>><br>
>> I configure my statefulSession as follows:<br>
>><br>
>> wm = (ReteooStatefulSession) ((KnowledgeBaseImpl) kagent<br>
>><br>
>> .getKnowledgeBase()).ruleBase.newStatefulSession(<br>
>> (SessionConfiguration) sessionConf, env);<br>
>> ksession = new StatefulKnowledgeSessionImpl(wm,<br>
>> kagent.getKnowledgeBase());<br>
>><br>
>> And after updating the KnowledgeBase in the agent I update my ksession:<br>
>><br>
>> wm.setRuleBase((InternalRuleBase) ((KnowledgeBaseImpl) kagent<br>
>><br>
>> .getKnowledgeBase()).ruleBase);<br>
>> ksession = new StatefulKnowledgeSessionImpl(wm,<br>
>> kagent.getKnowledgeBase());<br>
>><br>
>> Without using entry-points this approach works as expected, but using them<br>
>> it fails after the first update throwing the error:<br>
>><br>
>> Exception while processing message: java.lang.NullPointerException<br>
>> java.lang.NullPointerException<br>
>> at<br>
>> org.drools.reteoo.ReteooFactHandleFactory.newFactHandle(ReteooFactHandleFactory.java:54)<br>
>> at<br>
>> org.drools.common.AbstractFactHandleFactory.newFactHandle(AbstractFactHandleFactory.java:79)<br>
>> at<br>
>> org.drools.common.AbstractFactHandleFactory.newFactHandle(AbstractFactHandleFactory.java:66)<br>
>> at<br>
>> org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:109)<br>
>> at<br>
>> org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:80)<br>
>> at<br>
>> org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:28)<br>
>><br>
>> Browsing the drools core code I found the line that was throwing the<br>
>> exception and tried to get the same result by implementing:<br>
>><br>
>> if (!((InternalRuleBase) ((KnowledgeBaseImpl)<br>
>> ksession.getKnowledgeBase()).ruleBase)<br>
>> .getTypeDeclaration(fact.getClass()) ==<br>
>> null)<br>
>> <a href="http://log.info" target="_blank">log.info</a> (((InternalRuleBase) ((KnowledgeBaseImpl)<br>
>> ksession.getKnowledgeBase()).ruleBase)<br>
>><br>
>> .getTypeDeclaration(fact.getClass()).getTimestampExtractor().toString());<br>
>><br>
>> after updating my ksession. The result was the same, again the same<br>
>> exception thrown but my logger wrote:<br>
>> 18:01:50,232 INFO [ClassFieldExtractor class=MyPackage.MyFact<br>
>> field=myTimestampField]<br>
>><br>
>> So I dont know why the core is throwing that exception, is that<br>
>> implementation correct?, any ideas?<br>
>><br>
>><br>
>> Thanks,<br>
>><br>
>> Nestor<br>
>><br>
><br>
> --<br>
> 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>
> Sent from the drools - dev mailing list archive at Nabble.com.<br>
><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>
><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>