[rules-users] Help debugging NPE

Edson Tirelli tirelli at post.com
Wed Jun 24 09:14:55 EDT 2009


      Dirk,

      The problem seems not related to shadow facts, but to constraint
resolution and fact data extraction. It might be a bug or not... need more
info.
      In any case, the offending rule is not the one you showed. The
offending rule contains a double beta constraint in a join:

org.drools.common.
>
> DoubleBetaConstraints.isAllowedCachedRight(DoubleBetaConstraints.java:164)
>        at org.drools.reteoo.JoinNode.retractObject(JoinNode.java:189)


      Can you narrow it down? Did you tried with Drools 5.0.1?

      []s
      Edson

2009/6/24 Dirk Bergstrom <dirk at juniper.net>

> I'm running into an NPE using Drools 4.0.7, and I'm stumped by it
> (stacktrace
> below).  I made some changes to seemingly unrelated code, and this error
> started
> showing up.  It would help me to understand what's going on if someone
> could
> tell me roughly what's going on here.  Since the error is thrown by
> generated
> code (in what I assume is a shadow proxy), I can't tell what the offending
> null
> pointer is.  I'm not even entirely sure what's triggering the bug (it
> happens
> half an hour into the run of big multi-threaded application with about 40K
> objects in the working memory).
>
> Is this happening because:
>
> *) getRli_nums() in one of my PRRecord objects is returning a null value?
>
> *) There is a null PRRecord object backing the shadow proxy?
>
> *) Some other thing is null?
>
> *) I'm running into a bug in Drools?
>
> I stuck in this rule:
>
> when
>  $pr : PRRecord( rli_nums == null )
> then
>  System.out.println($pr.getId());
> end
>
> And it didn't print anything, so I'm inclined to think that this is not a
> simple
> matter of something returning a null value...
>
> I'll be most appreciative of any help I can get.
>
> Here's the stacktrace:
>
> java.lang.NullPointerException
>        at
>
> org.drools.base.net.juniper.dash.data.PRRecord13409648$getRli_nums.getValue(Unknown
> Source)
>        at
> org.drools.base.ClassFieldExtractor.getValue(ClassFieldExtractor.java:127)
>        at
>
> org.drools.base.evaluators.BaseMemberOfEvaluator.evaluateCachedRight(BaseMemberOfEvaluator.java:45)
>        at
>
> org.drools.rule.VariableRestriction.isAllowedCachedRight(VariableRestriction.java:89)
>        at
>
> org.drools.rule.VariableConstraint.isAllowedCachedRight(VariableConstraint.java:81)
>        at
>
> org.drools.common.DoubleBetaConstraints.isAllowedCachedRight(DoubleBetaConstraints.java:164)
>        at org.drools.reteoo.JoinNode.retractObject(JoinNode.java:189)
>        at
>
> org.drools.reteoo.CompositeObjectSinkAdapter.propagateRetractObject(CompositeObjectSinkAdapter.java:375)
>        at
> org.drools.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:189)
>        at org.drools.reteoo.Rete.retractObject(Rete.java:215)
>        at
> org.drools.reteoo.ReteooRuleBase.retractObject(ReteooRuleBase.java:211)
>        at
>
> org.drools.reteoo.ReteooWorkingMemory.doRetract(ReteooWorkingMemory.java:79)
>        at
>
> org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1250)
>        at
>
> org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1203)
>        at
>
> net.juniper.dash.data.DataSource.reconcileAssertedRecords(DataSource.java:409)
>
> --
> Dirk Bergstrom               dirk at juniper.net
> _____________________________________________
> Juniper Networks Inc.,          Computer Geek
> Tel: 408.745.3182           Fax: 408.745.8905
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 Edson Tirelli
 JBoss Drools Core Development
 JBoss by Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090624/18a8900c/attachment.html 


More information about the rules-users mailing list