<br> Dirk<br><br> Drools 5 is mostly backward compatible with Drools 4. You don't need to migrate to the new API, although it is recommended.<br><br> Anyway, I understand your concern. My wild wild guess is that the memberOf operator is complaining about a null in that constraint. If that is the case, it is a bug. I fixed some bugs like that in Drools 5 trunk:<br>
<br><a href="https://jira.jboss.org/jira/browse/JBRULES-2102">https://jira.jboss.org/jira/browse/JBRULES-2102</a><br><br> []s<br> Edson<br><br><br><br><br><div class="gmail_quote">2009/6/24 Dirk Bergstrom <span dir="ltr"><<a href="mailto:dirk@juniper.net">dirk@juniper.net</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;">Edson Tirelli was heard to exclaim, On 06/24/09 06:14:<br>
<div class="im">> The problem seems not related to shadow facts, but to constraint<br>
> resolution and fact data extraction. It might be a bug or not... need<br>
> more info.<br>
<br>
</div>I've also seen the following stacktrace:<br>
<br>
java.lang.ArrayIndexOutOfBoundsException: 40440<br>
at org.drools.util.TupleIndexHashTable.toArray(TupleIndexHashTable.java:217)<br>
at org.drools.reteoo.CollectNode.retractObject(CollectNode.java:260)<br>
at<br>
org.drools.reteoo.SingleObjectSinkAdapter.propagateRetractObject(SingleObjectSinkAdapter.java:32)<br>
at org.drools.reteoo.AlphaNode.retractObject(AlphaNode.java:164)<br>
at<br>
org.drools.reteoo.SingleObjectSinkAdapter.propagateRetractObject(SingleObjectSinkAdapter.java:32)<br>
at org.drools.reteoo.AlphaNode.retractObject(AlphaNode.java:164)<br>
at<br>
org.drools.reteoo.CompositeObjectSinkAdapter.propagateRetractObject(CompositeObjectSinkAdapter.java:366)<br>
<div class="im"> at org.drools.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:189)<br>
at org.drools.reteoo.Rete.retractObject(Rete.java:215)<br>
at org.drools.reteoo.ReteooRuleBase.retractObject(ReteooRuleBase.java:211)<br>
at<br>
org.drools.reteoo.ReteooWorkingMemory.doRetract(ReteooWorkingMemory.java:79)<br>
at<br>
</div>org.drools.common.AbstractWorkingMemory.retract(AbstractWorkingMemory.java:1023)<br>
at<br>
org.drools.common.AbstractWorkingMemory.retract(AbstractWorkingMemory.java:982)<br>
at<br>
net.juniper.dash.data.DataSource.reconcileAssertedRecords(DataSource.java:362)<br>
<div class="im"><br>
> In any case, the offending rule is not the one you showed. The<br>
> offending rule contains a double beta constraint in a join:<br>
<br>
</div>I know it's not in that rule. It must be in this one, since it's the only one<br>
that uses rli_nums:<br>
<br>
$npi : NPIRecord( )<br>
$pr : PRRecord( npi == "", rli != "" )<br>
$rli : RLIRecord( id memberOf $pr.rli_nums, npi_program == $npi.synopsis )<br>
<div class="im"><br>
> Can you narrow it down? Did you tried with Drools 5.0.1?<br>
<br>
</div>I haven't tried any of the 5.x series. Is there a guide to migrating my code<br>
from 4.0 to 5.0? I looked on the jboss site, the wiki, the blog, and this<br>
mailing list, but I didn't find anything. I'm under a lot of time pressure, and<br>
changing to 5.0 doesn't look like a quick fix...<br>
<br>
> 2009/6/24 Dirk Bergstrom <<a href="mailto:dirk@juniper.net">dirk@juniper.net</a> <mailto:<a href="mailto:dirk@juniper.net">dirk@juniper.net</a>>><br>
<div><div></div><div class="h5">><br>
> I'm running into an NPE using Drools 4.0.7, and I'm stumped by it<br>
> (stacktrace<br>
> below). I made some changes to seemingly unrelated code, and this<br>
> error started<br>
> showing up. It would help me to understand what's going on if<br>
> someone could<br>
> tell me roughly what's going on here. Since the error is thrown by<br>
> generated<br>
> code (in what I assume is a shadow proxy), I can't tell what the<br>
> offending null<br>
> pointer is. I'm not even entirely sure what's triggering the bug<br>
> (it happens<br>
> half an hour into the run of big multi-threaded application with<br>
> about 40K<br>
> objects in the working memory).<br>
><br>
> Is this happening because:<br>
><br>
> *) getRli_nums() in one of my PRRecord objects is returning a null<br>
> value?<br>
><br>
> *) There is a null PRRecord object backing the shadow proxy?<br>
><br>
> *) Some other thing is null?<br>
><br>
> *) I'm running into a bug in Drools?<br>
><br>
> I stuck in this rule:<br>
><br>
> when<br>
> $pr : PRRecord( rli_nums == null )<br>
> then<br>
> System.out.println($pr.getId());<br>
> end<br>
><br>
> And it didn't print anything, so I'm inclined to think that this is<br>
> not a simple<br>
> matter of something returning a null value...<br>
><br>
> I'll be most appreciative of any help I can get.<br>
><br>
> Here's the stacktrace:<br>
><br>
> java.lang.NullPointerException<br>
> at<br>
> org.drools.base.net.juniper.dash.data.PRRecord13409648$getRli_nums.getValue(Unknown<br>
> Source)<br>
> at<br>
> org.drools.base.ClassFieldExtractor.getValue(ClassFieldExtractor.java:127)<br>
> at<br>
> org.drools.base.evaluators.BaseMemberOfEvaluator.evaluateCachedRight(BaseMemberOfEvaluator.java:45)<br>
> at<br>
> org.drools.rule.VariableRestriction.isAllowedCachedRight(VariableRestriction.java:89)<br>
> at<br>
> org.drools.rule.VariableConstraint.isAllowedCachedRight(VariableConstraint.java:81)<br>
> at<br>
> org.drools.common.DoubleBetaConstraints.isAllowedCachedRight(DoubleBetaConstraints.java:164)<br>
> at org.drools.reteoo.JoinNode.retractObject(JoinNode.java:189)<br>
> at<br>
> org.drools.reteoo.CompositeObjectSinkAdapter.propagateRetractObject(CompositeObjectSinkAdapter.java:375)<br>
> at<br>
> org.drools.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:189)<br>
> at org.drools.reteoo.Rete.retractObject(Rete.java:215)<br>
> at<br>
> org.drools.reteoo.ReteooRuleBase.retractObject(ReteooRuleBase.java:211)<br>
> at<br>
> org.drools.reteoo.ReteooWorkingMemory.doRetract(ReteooWorkingMemory.java:79)<br>
> at<br>
> org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1250)<br>
> at<br>
> org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1203)<br>
> at<br>
> 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>