[rules-users] Interesting null pointer exception when inserting a fact.
Jason Partyka
Jason.Partyka at hightowerinc.com
Fri Mar 7 17:46:35 EST 2008
Hi,
This is in relation to drools 4.0.4
I have an interesting problem. I am getting a null pointer exception when I am inserting a fact into a StatefulSession object. What is odd about this NPE is that, as far as I can tell (and I have inserted a breakpoint right before I insert the fact) that all the properties in the object are initialized, and there are no rules accessing any thing that could be null.
So here's my exception trace (just first few lines to get context):
Exception in thread "AWT-EventQueue-0" org.drools.RuntimeDroolsException: java.lang.NullPointerException
at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:76)
at org.drools.reteoo.EvalConditionNode.assertTuple(EvalConditionNode.java:145)
at org.drools.reteoo.SingleTupleSinkAdapter.createAndPropagateAssertTuple(SingleTupleSinkAdapter.java:55)
at org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:116)
at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:22)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:153)
at org.drools.reteoo.Rete.assertObject(Rete.java:177)
at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
at org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:886)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:858)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:659)
at com.hightower.drools.executablerules.Rules.setTemplate(Rules.java:112)
....
Caused by: java.lang.NullPointerException
at org.drools.base.mvel.MVELEvalExpression.evaluate(MVELEvalExpression.java:39)
at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:72)
... 39 more
(that setTemplate method is not a drools template)
Any ideas?
Thanks,
Jason
More information about the rules-users
mailing list