Hello, Mauricio:

I've been trying to reduce the set of rules and facts as well as the condition elements to provide you a manageable example and this is the minimal set of rules that still shows the NullPointerException behaviour. I also attach a basic DroolsTest.java class which can be executed with these rules. I'm using Drools 5.1.1.

The strange interaction is as follows: 
Thank you very much for your time.

Best Regards,

Manuel Ortiz.

2011/3/31 Mauricio Salatino <salaboy@gmail.com>
can you share your rules, so we can take a look at what is happening?
The stack trace doesn't offer too much information to be able to analyze what happen.


2011/3/30 Manuel Ortiz <manuel.ortizramos@gmail.com>
Hello all!

I am new in Drools but day by day, test by test, I think I get a bit more knowledge of how the rule engine works from user point of view. I've been adding rules to an alarm system, increasing the complexity and functionality in several steps. Unfortunately in the last step I found the following NullPointerException inside the rule engine...

java.lang.NullPointerException
at org.drools.reteoo.AccumulateNode.getFirstMatch(AccumulateNode.java:967)
at org.drools.reteoo.AccumulateNode.modifyLeftTuple(AccumulateNode.java:329)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateModifyChildLeftTuple(SingleLeftTupleSinkAdapter.java:239)
at org.drools.reteoo.AccumulateNode.evaluateResultConstraints(AccumulateNode.java:640)
at org.drools.reteoo.AccumulateNode.assertObject(AccumulateNode.java:270)
at org.drools.reteoo.BetaNode.modifyObject(BetaNode.java:312)
at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateModifyObject(CompositeObjectSinkAdapter.java:460)
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateModifyObject(CompositeObjectSinkAdapter.java:428)
at org.drools.reteoo.AlphaNode.modifyObject(AlphaNode.java:160)
at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateModifyObject(CompositeObjectSinkAdapter.java:460)
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateModifyObject(CompositeObjectSinkAdapter.java:428)
at org.drools.reteoo.ObjectTypeNode.modifyObject(ObjectTypeNode.java:263)
at org.drools.reteoo.EntryPointNode.modifyObject(EntryPointNode.java:172)
at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1442)
at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1349)
at org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:183)
at org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:196)
at es.simcasva.alarmas.rules.Rule_Test_Negativo_Alarma_Acceso_Portal_Ubicacion_UM_0.defaultConsequence(Rule_Test_Negativo_Alarma_Acceso_Portal_Ubicacion_UM_0.java:18)
at es.simcasva.alarmas.rules.Rule_Test_Negativo_Alarma_Acceso_Portal_Ubicacion_UM_0DefaultConsequenceInvoker.evaluate(Rule_Test_Negativo_Alarma_Acceso_Portal_Ubicacion_UM_0DefaultConsequenceInvoker.java:44)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:917)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:856)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1071)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:785)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:751)
at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:218)

I've been trying to find the problem, and found a strange interaction between three rules that makes the null pointer to appear. The alarm system has many rules now and it is difficult to simplify the scenario, so I just would like to know what is the funcion of AccumulateNode object in order to have an idea of the NullPointerException possible cause.

Can anyone help me?

Thank you in advance for your time.

Regards,

Manuel Ortiz.


_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




--
 - CTO @ http://www.plugtree.com 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jbug.com.ar
 
 - Salatino "Salaboy" Mauricio -