One way of helping isolating the problem is to set a break point for a
NullPointerException. When the exception is raised do 2 things:
1. In the RuleTerminalNode where the NPE is generated, check the content of
the "rule" attribute. This will tell you the offending rule.
2. Check which reference is null in the offending line:
item.setSalience( rule.getSalience().getValue( tuple,
this.rule,
workingMemory
) );
Probably "item" is null.
After that, it should be easy to isolate and simplify the 2 rules that
are raising the problem. The one with the modify in the consequence (R1) and
the other one where the NPE is occurring (R2).
Finally, if you use the audit log, you can see the scenario where it
happens. It is probably activating R2 and before firing it, triggering a
modify that maintains it active, or some variation in the scenario.
Once you have this data, it will be possible for us to analyze the case
and fix the problem.
Edson
2011/10/3 Jamie <jshaw(a)llbean.com>
I recently upgraded from 5.2.0 Final to 5.3.0 CR1 because I was
experiencing
memory leaks in 5.2.0 Final due to a known bug that was fixed in 5.3.0 CR1.
I have a suite of FitNesse tests that exercise the majority of my rules and
flows, and I can demonstrate that the memory leak is indeed fixed, but one
of my tests is now failing. If I revert back to 5.2.0 Final, all is well.
I've been trying to determine the root cause for the past 3 days, but I'm
not getting anywhere. I suspect that it's related to an interaction
between
2 rules, e.g. one rule modifies something that causes the second rule to
fire, but the second rule chokes in the consequence when it tries to
execute
a modify() statement. If I comment out the modify portion, the rule fires
fine.
I wish I could provide an example, but my implementation is too complex for
that and I haven't been able to reproduce it in a stand-alone example.
I know a stack trace probably won't tell you much, but I've included it
below just in case. If anyone has any ideas, I'd love to hear them. If
there's any additional information you think might help diagnose the
problem, I'd be happy to provide it.
Thanks,
Jamie
org.drools.runtime.rule.ConsequenceException: rule: Rule 022 - Load Buyer
Activity
at
org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
at
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1101)
at
org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1029)
at
org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1251)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:708)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:672)
at
org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:218)
at
com.llbean.fraud.rule.engine.DroolsRulesEngine.invokeRules(DroolsRulesEngine.java:119)
at
com.llbean.fraud.rule.engine.DroolsRulesEngine.invokeRules(DroolsRulesEngine.java:81)
at
com.llbean.fraud.fitnesse.fixtures.tests.TestFraudRules.execute(TestFraudRules.java:116)
at fit.ColumnFixture.executeIfNeeded(ColumnFixture.java:57)
at fit.ColumnFixture.check(ColumnFixture.java:46)
at fit.Binding$QueryBinding.doCell(Binding.java:188)
at fit.ColumnFixture.doCell(ColumnFixture.java:37)
at fit.Fixture.doCells(Fixture.java:171)
at fit.Fixture.doRow(Fixture.java:165)
at fit.ColumnFixture.doRow(ColumnFixture.java:25)
at fit.Fixture.doRows(Fixture.java:159)
at fit.ColumnFixture.doRows(ColumnFixture.java:18)
at fit.Fixture.doTable(Fixture.java:153)
at fit.Fixture.interpretFollowingTables(Fixture.java:119)
at fit.Fixture.interpretTables(Fixture.java:105)
at fit.Fixture.doTables(Fixture.java:79)
at
com.llbean.test.fitnesse.servletrunner.server.LLBFitServer.process(LLBFitServer.java:120)
at
com.llbean.test.fitnesse.servletrunner.server.LLBFitServer.runTests(LLBFitServer.java:40)
at
com.llbean.test.fitnesse.servletrunner.servlet.FitServlet.service(FitServlet.java:32)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1530)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:829)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:458)
at
com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
at
com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:862)
at
com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:178)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:272)
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at
com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1550)
Caused by: java.lang.NullPointerException
at
org.drools.reteoo.RuleTerminalNode.createActivations(RuleTerminalNode.java:276)
at
org.drools.reteoo.RuleTerminalNode.modifyLeftTuple(RuleTerminalNode.java:326)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateModifyChildLeftTuple(SingleLeftTupleSinkAdapter.java:273)
at
org.drools.reteoo.EvalConditionNode.modifyLeftTuple(EvalConditionNode.java:234)
at
org.drools.reteoo.CompositeLeftTupleSinkAdapter.propagateModifyChildLeftTuple(CompositeLeftTupleSinkAdapter.java:295)
at org.drools.reteoo.JoinNode.modifyLeftTuple(JoinNode.java:380)
at org.drools.reteoo.BetaNode.modifyLeftTuple(BetaNode.java:450)
at org.drools.reteoo.JoinNode.modifyLeftTuple(JoinNode.java:446)
at
org.drools.reteoo.CompositeLeftTupleSinkAdapter.doPropagateModifyObject(CompositeLeftTupleSinkAdapter.java:260)
at
org.drools.reteoo.CompositeLeftTupleSinkAdapter.propagateModifyObject(CompositeLeftTupleSinkAdapter.java:275)
at
org.drools.reteoo.LeftInputAdapterNode.modifyObject(LeftInputAdapterNode.java:174)
at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateModifyObject(CompositeObjectSinkAdapter.java:461)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateModifyObject(CompositeObjectSinkAdapter.java:429)
at
org.drools.reteoo.ObjectTypeNode.modifyObject(ObjectTypeNode.java:277)
at
org.drools.reteoo.EntryPointNode.modifyObject(EntryPointNode.java:271)
at
org.drools.common.NamedEntryPoint.update(NamedEntryPoint.java:459)
at
org.drools.common.NamedEntryPoint.update(NamedEntryPoint.java:363)
at
org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:298)
at
com.llbean.droolstest.Rule_Rule_022___Load_Buyer_Activity.defaultConsequence(Rule_Rule_022___Load_Buyer_Activity.java:15)
at
com.llbean.droolstest.Rule_Rule_022___Load_Buyer_ActivityDefaultConsequenceInvokerGenerated.evaluate(Unknown
Source)
at
com.llbean.droolstest.Rule_Rule_022___Load_Buyer_ActivityDefaultConsequenceInvoker.evaluate(Unknown
Source)
at
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1091)
... 45 more
--
View this message in context:
http://drools.46999.n3.nabble.com/5-3-0-CR1-has-broken-existing-rules-flo...
Sent from the Drools: User forum mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat @
www.jboss.com