[rules-users] NPE with modify

Scott Reed sreed at spamcop.net
Wed Jan 24 23:52:00 EST 2007


I am getting an NPE when I uncomment the modify call in the rule below.
I am running version 3.0.4.
I'd appreciate any ideas as to why this is happening.
Thanks,
  Scott

rule "TEST"
   when
       $paystub: Paystub( $grossPay: grossPay )
       eval( $grossPay.getState() == FPConstants.INACTIVE )
   then
       $grossPay.setState( FPConstants.READY );
       //modify( $paystub );
end

With modify uncommented I get the following exception:

java.lang.NullPointerException
   at org.drools.reteoo.beta.DefaultRightMemory.remove(Unknown Source)
   at org.drools.reteoo.BetaMemory.remove(Unknown Source)
   at org.drools.reteoo.JoinNode.modifyObject(Unknown Source)
   at org.drools.reteoo.ObjectSource.propagateModifyObject(Unknown Source)
   at org.drools.reteoo.ObjectTypeNode.modifyObject(Unknown Source)
   at org.drools.reteoo.Rete.modifyObject(Unknown Source)
   at org.drools.reteoo.ReteooRuleBase.modifyObject(Unknown Source)
   at org.drools.reteoo.ReteooWorkingMemory.modifyObject(Unknown Source)
   at org.drools.base.DefaultKnowledgeHelper.modifyObject(Unknown Source)
   at
org.fp.findata.Rule_Precalc___TEST_0.consequence(Rule_Precalc___TEST_0.java:14) 


   at
org.fp.findata.Rule_Precalc___TEST_0ConsequenceInvoker.evaluate(Rule_Precalc___TEST_0ConsequenceInvoker.java:29) 


   at org.drools.common.DefaultAgenda.fireActivation(Unknown Source)
   at org.drools.common.DefaultAgenda.fireNextItem(Unknown Source)
   at org.drools.common.AbstractWorkingMemory.fireAllRules(Unknown Source)
   at org.drools.common.AbstractWorkingMemory.fireAllRules(Unknown Source)
   at org.fp.util.RuleEngineManager$RunTask.run(RuleEngineManager.java:159)




More information about the rules-users mailing list