Hi Thomas,<br><br>thanks for your reply. If I got you right, the crash happens because the following rule will be evaluated if we insert the value &quot;knocking&quot;<br><br><pre><span class="drools-rule"><span style="font-weight: bold;">rule</span> &quot;<span style="font-weight: bold; text-decoration: underline; color: rgb(52, 101, 164);">R49</span>&quot;<br>
  <span style="font-weight: bold;">when</span><br>    <span style="color: rgb(150, 90, 180);">$value1</span> : Value(value == <span style="color: rgb(125, 80, 102);">&quot;knocking&quot;</span>)<br>    Input(name == <span style="color: rgb(125, 80, 102);">&quot;Engine noises&quot;</span> &amp;&amp; values contains <span style="color: rgb(150, 90, 180);">$value1</span>)<br>
    or<br>    <span style="color: rgb(150, 90, 180);">$value2</span> : Value(value == <span style="color: rgb(125, 80, 102);">&quot;ringing&quot;</span>)<br>    Input(name == <span style="color: rgb(125, 80, 102);">&quot;Engine noises&quot;</span> &amp;&amp; values contains <span style="color: rgb(150, 90, 180);">$value2</span>)<br>
    <span style="color: rgb(150, 90, 180);">$solution</span> : SolutionInput(name == <span style="color: rgb(125, 80, 102);">&quot;Bad ignition timing&quot;</span>)<br>  <span style="font-weight: bold;">then</span><br>    <span style="color: rgb(150, 90, 180);">$solution</span>.setValue(P5);<br>
<span style="font-weight: bold;">end<br></span></span><br></pre>and the value &quot;ringing&quot; wasn&#39;t inserted before?<br><br>Thank you in advance for your reply.<br><br>Best regards<br><br>Sebastian<br clear="all">
_____________________________________<br><br>Sebastian Furth<br>Gabelsbergerstraße 6<br>97080 Würzburg<br><br>Tel. 0931-30170294<br>Mobil. 0171-7592673<br>
<br><br><div class="gmail_quote">2010/3/23 Swindells, Thomas <span dir="ltr">&lt;<a href="mailto:TSwindells@nds.com">TSwindells@nds.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;">






<div link="blue" vlink="purple" lang="EN-GB">
<div>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">The most likely reason for this is that one of your rules is trying to evaluate a value which is null.   The when part of a rule is evaluated as the fact
 is inserted and may be evaluated even if the then part will never be reached.</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Looking at your stack trace it looks like the rule involved may have a NOT in it.  Have a careful look through your rules and see if there is a case where
 a null pointer may occur and/or try removing them one by one until it stops breaking, if that doesn’t work can you post your rules as well.</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Thomas</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<div style="border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color blue; border-width: medium medium medium 1.5pt; padding: 0cm 0cm 0cm 4pt;">
<div>
<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0cm 0cm;">
<p class="MsoNormal"><b><span style="font-size: 10pt;" lang="EN-US">From:</span></b><span style="font-size: 10pt;" lang="EN-US"> <a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a> [mailto:<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>]
<b>On Behalf Of </b>Sebastian Furth<br>
<b>Sent:</b> 23 March 2010 13:11<br>
<b>To:</b> <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<b>Subject:</b> [rules-users] NullPointerException while inserting Facts</span></p>
</div>
</div><div><div></div><div class="h5">
<p class="MsoNormal"> </p>
<p class="MsoNormal">Hi,<br>
<br>
we are currently trying to integrate DROOLS 5.1 in our project. <br>
In our Project we have two different kinds of Facts, called Values and Inputs. We don&#39;t have any problems with inserting Input instances but sometimes when we try to insert an instance of the Value class (@see:
<a href="http://www.pastie.org/private/juv7hh7rxahpluo5agu3q" target="_blank">http://www.pastie.org/private/juv7hh7rxahpluo5agu3q</a>) we get the following NullPointerException:<br>
<br>
java.lang.NullPointerException<br>
    at org.drools.reteoo.LeftTuple.get(LeftTuple.java:265)<br>
    at org.drools.reteoo.LeftTuple.get(LeftTuple.java:300)<br>
    at org.drools.rule.VariableRestriction$ObjectVariableContextEntry.updateFromTuple(VariableRestriction.java:320)<br>
    at org.drools.common.SingleBetaConstraints.updateFromTuple(SingleBetaConstraints.java:119)<br>
    at org.drools.reteoo.NotNode.assertLeftTuple(NotNode.java:98)<br>
    at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:117)<br>
    at org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:34)<br>
    at org.drools.reteoo.NotNode.assertLeftTuple(NotNode.java:123)<br>
    at org.drools.reteoo.CompositeLeftTupleSinkAdapter.doPropagateAssertLeftTuple(CompositeLeftTupleSinkAdapter.java:145)<br>
    at org.drools.reteoo.CompositeLeftTupleSinkAdapter.createAndPropagateAssertLeftTuple(CompositeLeftTupleSinkAdapter.java:57)<br>
    at org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:142)<br>
    at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:42)<br>
    at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:147)<br>
    at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:360)<br>
    at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:344)<br>
    at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:185)<br>
    at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:146)<br>
    at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1046)<br>
    at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1001)<br>
    at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:788)<br>
    at org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:216)<br>
    at de.d3web.we.drools.DroolsAction.addFacts(DroolsAction.java:296)<br>
    at de.d3web.we.drools.DroolsAction.createKnowledgeSession(DroolsAction.java:268)<br>
    at de.d3web.we.drools.DroolsAction.execute(DroolsAction.java:67)<br>
<br>
The weird thing is that we don&#39;t get this exception with all instances of the Value class - some of them can be inserted, others not. The objects are created correctly - we&#39;ve already debugged this. The crash happens somewhere deeper in the drools api.<br clear="all">

<br>
It would be really great if you could give us a hint how we could fix this problem.<br>
<br>
Thank you in advance.<br>
<br>
Best regards<br>
<br>
Sebastian Furth</p>
</div></div></div>
</div>
<br>
<hr>
<font color="Gray" face="Arial" size="1"><br>
**************************************************************************************<br>
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the <a href="mailto:postmaster@nds.com" target="_blank">postmaster@nds.com</a> and delete it from your system as well as any copies. The content of e-mails as well as traffic data
 may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.<br>
<br>
NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00<br>
**************************************************************************************<br>
</font><br>
<hr>
<font color="Gray" face="Arial" size="1">This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the <a href="mailto:postmaster@nds.com" target="_blank">postmaster@nds.com</a> and delete it from your system as well as any copies. The
 content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes.<br>
To protect the environment please do not print this e-mail unless necessary.<br>
<br>
An NDS Group Limited company. <a href="http://www.nds.com" target="_blank">www.nds.com</a><br>
</font>
</div>

<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>
<br></blockquote></div><br>