Philip Harding created DROOLS-3066:
--------------------------------------
Summary: NPE in Drools
org.drools.core.rule.SingleAccumulate.reverse(SingleAccumulate.java:124)
Key: DROOLS-3066
URL:
https://issues.jboss.org/browse/DROOLS-3066
Project: Drools
Issue Type: Bug
Components: executable model
Affects Versions: 7.4.1.Final
Environment: Windows 7
Oracle Java Development Kit 1.8.0_111
Eclipse Oxygen 3a
Optaplanner 7.4.1.Final
Reporter: Philip Harding
Assignee: Luca Molteni
Attachments: NPE_Drools_MWE.zip
The rule
{code:java}
rule "globalRequiredPredecessorAfterMe"
when
$rpAll: Set(size>1) from accumulate (
Customer(Domicile != null, $rpAfterMe: requiredPredecessorsAfterMe);
collectSet($rpAfterMe)
)
then
scoreHolder.addMediumConstraintMatch(kcontext, - $rpAll.size()-1);
end
{code}
gives following NPE within the attached Optaplanner model:
{code:java}
Exception in thread "main" java.lang.RuntimeException:
java.lang.NullPointerException
at org.drools.core.rule.SingleAccumulate.reverse(SingleAccumulate.java:124)
at
org.drools.core.phreak.PhreakAccumulateNode.removeMatch(PhreakAccumulateNode.java:796)
at
org.drools.core.phreak.PhreakAccumulateNode.doRightUpdatesProcessChildren(PhreakAccumulateNode.java:517)
at
org.drools.core.phreak.PhreakAccumulateNode.doRightUpdates(PhreakAccumulateNode.java:450)
at org.drools.core.phreak.PhreakAccumulateNode.doNode(PhreakAccumulateNode.java:76)
at
org.drools.core.phreak.RuleNetworkEvaluator.switchOnDoBetaNode(RuleNetworkEvaluator.java:581)
at
org.drools.core.phreak.RuleNetworkEvaluator.evalBetaNode(RuleNetworkEvaluator.java:552)
at org.drools.core.phreak.RuleNetworkEvaluator.evalNode(RuleNetworkEvaluator.java:379)
at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:339)
at org.drools.core.phreak.RuleNetworkEvaluator.outerEval(RuleNetworkEvaluator.java:175)
at
org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(RuleNetworkEvaluator.java:133)
at org.drools.core.phreak.RuleExecutor.reEvaluateNetwork(RuleExecutor.java:212)
at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:87)
at
org.drools.core.concurrent.AbstractRuleEvaluator.internalEvaluateAndFire(AbstractRuleEvaluator.java:34)
at
org.drools.core.concurrent.SequentialRuleEvaluator.evaluateAndFire(SequentialRuleEvaluator.java:43)
at org.drools.core.common.DefaultAgenda.fireLoop(DefaultAgenda.java:1067)
at org.drools.core.common.DefaultAgenda.internalFireAllRules(DefaultAgenda.java:1014)
at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1006)
at
org.drools.core.impl.StatefulKnowledgeSessionImpl.internalFireAllRules(StatefulKnowledgeSessionImpl.java:1337)
at
org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1328)
at
org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1312)
at
org.optaplanner.core.impl.score.director.drools.DroolsScoreDirector.calculateScore(DroolsScoreDirector.java:117)
at
org.optaplanner.core.impl.score.director.AbstractScoreDirector.doAndProcessMove(AbstractScoreDirector.java:187)
at
org.optaplanner.core.impl.constructionheuristic.decider.ConstructionHeuristicDecider.doMove(ConstructionHeuristicDecider.java:126)
at
org.optaplanner.core.impl.constructionheuristic.decider.ConstructionHeuristicDecider.decideNextStep(ConstructionHeuristicDecider.java:100)
at
org.optaplanner.core.impl.constructionheuristic.DefaultConstructionHeuristicPhase.solve(DefaultConstructionHeuristicPhase.java:74)
at org.optaplanner.core.impl.solver.AbstractSolver.runPhases(AbstractSolver.java:88)
at org.optaplanner.core.impl.solver.DefaultSolver.solve(DefaultSolver.java:191)
at canihazafischbroetchenplz.app.TestApp.main(TestApp.java:35)
Caused by: java.lang.NullPointerException
at
org.drools.core.base.accumulators.CollectSetAccumulateFunction.reverse(CollectSetAccumulateFunction.java:118)
at
org.drools.core.base.accumulators.CollectSetAccumulateFunction.reverse(CollectSetAccumulateFunction.java:49)
at
org.drools.core.base.accumulators.JavaAccumulatorFunctionExecutor.reverse(JavaAccumulatorFunctionExecutor.java:133)
at org.drools.core.rule.SingleAccumulate.reverse(SingleAccumulate.java:116)
... 28 more
{code}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)