<br>   Oh, ok. Then it is shadow proxy related. :)<br><br>   Shadow proxies can&#39;t override final methods, and if they can&#39;t override them, they can not safely prevent hashcode changes at unsafe points... and that causes all kind of problems with hashmaps that are used internally.<br>
<br>   Drools 5 no longer requires shadow proxies. One more reason to move forward. :)<br><br>   []s<br>   Edson<br><br><div class="gmail_quote">2009/6/25 Dirk Bergstrom <span dir="ltr">&lt;<a href="mailto:dirk@juniper.net">dirk@juniper.net</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;">Edson Tirelli was heard to exclaim, On 06/24/09 15:43:<br>
<div class="im">&gt;     Drools 5 is mostly backward compatible with Drools 4. You don&#39;t need<br>
&gt; to migrate to the new API, although it is recommended.<br>
<br>
</div>Ahh, that&#39;s good to know.  You might want to mention that somewhere in the<br>
release notes, or on the website.  It would probably improve the adoption rate.<br>
<div class="im"><br>
&gt;     Anyway, I understand your concern. My wild wild guess is that the<br>
&gt; memberOf operator is complaining about a null in that constraint.<br>
<br>
</div>Nope, it&#39;s stranger than that.  The problem arose because I&#39;d changed the<br>
hashCode() method of the base Record class to a final method.  I un-finalized<br>
the method, and the NPEs stopped happening.<br>
<br>
I don&#39;t understand how this could cause a problem, but I&#39;m pretty sure it&#39;s a<br>
bug in Drools.  Once I get some free time, I&#39;m going to test the code with 5.0,<br>
and I&#39;ll see if the bug shows up there.<br>
<div><div></div><div class="h5"><br>
&gt; 2009/6/24 Dirk Bergstrom &lt;<a href="mailto:dirk@juniper.net">dirk@juniper.net</a> &lt;mailto:<a href="mailto:dirk@juniper.net">dirk@juniper.net</a>&gt;&gt;<br>
&gt;<br>
&gt;     Edson Tirelli was heard to exclaim, On 06/24/09 06:14:<br>
&gt;     &gt;       The problem seems not related to shadow facts, but to constraint<br>
&gt;     &gt; resolution and fact data extraction. It might be a bug or not... need<br>
&gt;     &gt; more info.<br>
&gt;<br>
&gt;     I&#39;ve also seen the following stacktrace:<br>
&gt;<br>
&gt;     java.lang.ArrayIndexOutOfBoundsException: 40440<br>
&gt;            at<br>
&gt;     org.drools.util.TupleIndexHashTable.toArray(TupleIndexHashTable.java:217)<br>
&gt;            at<br>
&gt;     org.drools.reteoo.CollectNode.retractObject(CollectNode.java:260)<br>
&gt;            at<br>
&gt;     org.drools.reteoo.SingleObjectSinkAdapter.propagateRetractObject(SingleObjectSinkAdapter.java:32)<br>
&gt;            at org.drools.reteoo.AlphaNode.retractObject(AlphaNode.java:164)<br>
&gt;            at<br>
&gt;     org.drools.reteoo.SingleObjectSinkAdapter.propagateRetractObject(SingleObjectSinkAdapter.java:32)<br>
&gt;            at org.drools.reteoo.AlphaNode.retractObject(AlphaNode.java:164)<br>
&gt;            at<br>
&gt;     org.drools.reteoo.CompositeObjectSinkAdapter.propagateRetractObject(CompositeObjectSinkAdapter.java:366)<br>
&gt;            at<br>
&gt;     org.drools.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:189)<br>
&gt;            at org.drools.reteoo.Rete.retractObject(Rete.java:215)<br>
&gt;            at<br>
&gt;     org.drools.reteoo.ReteooRuleBase.retractObject(ReteooRuleBase.java:211)<br>
&gt;            at<br>
&gt;     org.drools.reteoo.ReteooWorkingMemory.doRetract(ReteooWorkingMemory.java:79)<br>
&gt;            at<br>
&gt;     org.drools.common.AbstractWorkingMemory.retract(AbstractWorkingMemory.java:1023)<br>
&gt;            at<br>
&gt;     org.drools.common.AbstractWorkingMemory.retract(AbstractWorkingMemory.java:982)<br>
&gt;            at<br>
&gt;     net.juniper.dash.data.DataSource.reconcileAssertedRecords(DataSource.java:362)<br>
&gt;<br>
&gt;     &gt;       In any case, the offending rule is not the one you showed. The<br>
&gt;     &gt; offending rule contains a double beta constraint in a join:<br>
&gt;<br>
&gt;     I know it&#39;s not in that rule.  It must be in this one, since it&#39;s<br>
&gt;     the only one<br>
&gt;     that uses rli_nums:<br>
&gt;<br>
&gt;     $npi : NPIRecord( )<br>
&gt;     $pr : PRRecord( npi == &quot;&quot;, rli != &quot;&quot; )<br>
&gt;     $rli : RLIRecord( id memberOf $pr.rli_nums, npi_program ==<br>
&gt;     $npi.synopsis )<br>
&gt;<br>
&gt;     &gt;       Can you narrow it down? Did you tried with Drools 5.0.1?<br>
&gt;<br>
&gt;     I haven&#39;t tried any of the 5.x series.  Is there a guide to<br>
&gt;     migrating my code<br>
&gt;     from 4.0 to 5.0?  I looked on the jboss site, the wiki, the blog,<br>
&gt;     and this<br>
&gt;     mailing list, but I didn&#39;t find anything.  I&#39;m under a lot of time<br>
&gt;     pressure, and<br>
&gt;     changing to 5.0 doesn&#39;t look like a quick fix...<br>
&gt;<br>
&gt;     &gt; 2009/6/24 Dirk Bergstrom &lt;<a href="mailto:dirk@juniper.net">dirk@juniper.net</a><br>
</div></div>&gt;     &lt;mailto:<a href="mailto:dirk@juniper.net">dirk@juniper.net</a>&gt; &lt;mailto:<a href="mailto:dirk@juniper.net">dirk@juniper.net</a><br>
<div><div></div><div class="h5">&gt;     &lt;mailto:<a href="mailto:dirk@juniper.net">dirk@juniper.net</a>&gt;&gt;&gt;<br>
&gt;     &gt;<br>
&gt;     &gt;     I&#39;m running into an NPE using Drools 4.0.7, and I&#39;m stumped by it<br>
&gt;     &gt;     (stacktrace<br>
&gt;     &gt;     below).  I made some changes to seemingly unrelated code, and this<br>
&gt;     &gt;     error started<br>
&gt;     &gt;     showing up.  It would help me to understand what&#39;s going on if<br>
&gt;     &gt;     someone could<br>
&gt;     &gt;     tell me roughly what&#39;s going on here.  Since the error is<br>
&gt;     thrown by<br>
&gt;     &gt;     generated<br>
&gt;     &gt;     code (in what I assume is a shadow proxy), I can&#39;t tell what the<br>
&gt;     &gt;     offending null<br>
&gt;     &gt;     pointer is.  I&#39;m not even entirely sure what&#39;s triggering the bug<br>
&gt;     &gt;     (it happens<br>
&gt;     &gt;     half an hour into the run of big multi-threaded application with<br>
&gt;     &gt;     about 40K<br>
&gt;     &gt;     objects in the working memory).<br>
&gt;     &gt;<br>
&gt;     &gt;     Is this happening because:<br>
&gt;     &gt;<br>
&gt;     &gt;     *) getRli_nums() in one of my PRRecord objects is returning a null<br>
&gt;     &gt;     value?<br>
&gt;     &gt;<br>
&gt;     &gt;     *) There is a null PRRecord object backing the shadow proxy?<br>
&gt;     &gt;<br>
&gt;     &gt;     *) Some other thing is null?<br>
&gt;     &gt;<br>
&gt;     &gt;     *) I&#39;m running into a bug in Drools?<br>
&gt;     &gt;<br>
&gt;     &gt;     I stuck in this rule:<br>
&gt;     &gt;<br>
&gt;     &gt;     when<br>
&gt;     &gt;      $pr : PRRecord( rli_nums == null )<br>
&gt;     &gt;     then<br>
&gt;     &gt;      System.out.println($pr.getId());<br>
&gt;     &gt;     end<br>
&gt;     &gt;<br>
&gt;     &gt;     And it didn&#39;t print anything, so I&#39;m inclined to think that<br>
&gt;     this is<br>
&gt;     &gt;     not a simple<br>
&gt;     &gt;     matter of something returning a null value...<br>
&gt;     &gt;<br>
&gt;     &gt;     I&#39;ll be most appreciative of any help I can get.<br>
&gt;     &gt;<br>
&gt;     &gt;     Here&#39;s the stacktrace:<br>
&gt;     &gt;<br>
&gt;     &gt;     java.lang.NullPointerException<br>
&gt;     &gt;            at<br>
&gt;     &gt;<br>
&gt;     org.drools.base.net.juniper.dash.data.PRRecord13409648$getRli_nums.getValue(Unknown<br>
&gt;     &gt;     Source)<br>
&gt;     &gt;            at<br>
&gt;     &gt;<br>
&gt;     org.drools.base.ClassFieldExtractor.getValue(ClassFieldExtractor.java:127)<br>
&gt;     &gt;            at<br>
&gt;     &gt;<br>
&gt;     org.drools.base.evaluators.BaseMemberOfEvaluator.evaluateCachedRight(BaseMemberOfEvaluator.java:45)<br>
&gt;     &gt;            at<br>
&gt;     &gt;<br>
&gt;     org.drools.rule.VariableRestriction.isAllowedCachedRight(VariableRestriction.java:89)<br>
&gt;     &gt;            at<br>
&gt;     &gt;<br>
&gt;     org.drools.rule.VariableConstraint.isAllowedCachedRight(VariableConstraint.java:81)<br>
&gt;     &gt;            at<br>
&gt;     &gt;<br>
&gt;     org.drools.common.DoubleBetaConstraints.isAllowedCachedRight(DoubleBetaConstraints.java:164)<br>
&gt;     &gt;            at<br>
&gt;     org.drools.reteoo.JoinNode.retractObject(JoinNode.java:189)<br>
&gt;     &gt;            at<br>
&gt;     &gt;<br>
&gt;     org.drools.reteoo.CompositeObjectSinkAdapter.propagateRetractObject(CompositeObjectSinkAdapter.java:375)<br>
&gt;     &gt;            at<br>
&gt;     &gt;<br>
&gt;     org.drools.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:189)<br>
&gt;     &gt;            at org.drools.reteoo.Rete.retractObject(Rete.java:215)<br>
&gt;     &gt;            at<br>
&gt;     &gt;<br>
&gt;     org.drools.reteoo.ReteooRuleBase.retractObject(ReteooRuleBase.java:211)<br>
&gt;     &gt;            at<br>
&gt;     &gt;<br>
&gt;     org.drools.reteoo.ReteooWorkingMemory.doRetract(ReteooWorkingMemory.java:79)<br>
&gt;     &gt;            at<br>
&gt;     &gt;<br>
&gt;     org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1250)<br>
&gt;     &gt;            at<br>
&gt;     &gt;<br>
&gt;     org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1203)<br>
&gt;     &gt;            at<br>
&gt;     &gt;<br>
&gt;     net.juniper.dash.data.DataSource.reconcileAssertedRecords(DataSource.java:409)<br>
<br>
<br>
--<br>
Dirk Bergstrom               <a href="mailto:dirk@juniper.net">dirk@juniper.net</a><br>
_____________________________________________<br>
Juniper Networks Inc.,          Computer Geek<br>
Tel: 408.745.3182           Fax: 408.745.8905<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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>