[
https://issues.jboss.org/browse/DROOLS-1686?page=com.atlassian.jira.plugi...
]
Geoffrey De Smet moved PLANNER-845 to DROOLS-1686:
--------------------------------------------------
Project: Drools (was: OptaPlanner)
Key: DROOLS-1686 (was: PLANNER-845)
Component/s: core engine
(was: optaplanner-examples)
Affects Version/s: 7.1.0.Final
(was: 7.1.0.Final)
NPE using drools accumulate function in fairness constraint (tennis
example)
----------------------------------------------------------------------------
Key: DROOLS-1686
URL:
https://issues.jboss.org/browse/DROOLS-1686
Project: Drools
Issue Type: Bug
Components: core engine
Affects Versions: 7.1.0.Final
Environment: openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-b11)
OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)
Reporter: Markus Müller
Assignee: Mario Fusco
Attachments: TennisConstraintsTest.java
Using the LoadBalanceAccumulateFunction found in tennis example for modelling fairness
constraints leads to NPE in drools itself, in FromNodeLeftTuple.java:
{code}
Caused by: java.lang.NullPointerException
at
org.drools.core.reteoo.FromNodeLeftTuple.getAccumulatedObjects(FromNodeLeftTuple.java:98)
{code}
Full stacktrace:
{code:java}
Exception executing consequence for rule "fairAssignmentCountPerTeam" in
org.optaplanner.examples.tennis.solver: java.lang.NullPointerException
at
org.drools.core.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
at org.drools.core.common.DefaultAgenda.handleException(DefaultAgenda.java:1252)
at org.drools.core.phreak.RuleExecutor.innerFireActivation(RuleExecutor.java:438)
at org.drools.core.phreak.RuleExecutor.fireActivation(RuleExecutor.java:379)
at org.drools.core.phreak.RuleExecutor.fire(RuleExecutor.java:135)
at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:88)
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:1068)
at
org.drools.core.common.DefaultAgenda.internalFireAllRules(DefaultAgenda.java:1015)
at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1007)
at
org.drools.core.impl.StatefulKnowledgeSessionImpl.internalFireAllRules(StatefulKnowledgeSessionImpl.java:1320)
at
org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1311)
at
org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1295)
at
org.optaplanner.core.impl.score.director.drools.DroolsScoreDirector.calculateScore(DroolsScoreDirector.java:117)
at
org.optaplanner.test.impl.score.AbstractScoreVerifier.assertWeight(AbstractScoreVerifier.java:82)
at
org.optaplanner.test.impl.score.buildin.hardmediumsoft.HardMediumSoftScoreVerifier.assertSoftWeight(HardMediumSoftScoreVerifier.java:107)
at
org.optaplanner.test.impl.score.buildin.hardmediumsoft.HardMediumSoftScoreVerifier.assertSoftWeight(HardMediumSoftScoreVerifier.java:94)
at
org.optaplanner.examples.tennis.TennisConstraintsTest.fairAssignmentCountPerTeam(TennisConstraintsTest.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at
com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51)
at
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.lang.NullPointerException
at
org.drools.core.reteoo.FromNodeLeftTuple.getAccumulatedObjects(FromNodeLeftTuple.java:98)
at org.drools.core.common.AgendaItem.getObjectsDeep(AgendaItem.java:78)
at
org.drools.core.reteoo.RuleTerminalNodeLeftTuple.getObjectsDeep(RuleTerminalNodeLeftTuple.java:359)
at
org.optaplanner.core.api.score.holder.AbstractScoreHolder.extractJustificationList(AbstractScoreHolder.java:118)
at
org.optaplanner.core.api.score.holder.AbstractScoreHolder.registerConstraintMatch(AbstractScoreHolder.java:88)
at
org.optaplanner.core.api.score.buildin.hardmediumsoft.HardMediumSoftScoreHolder.addMediumConstraintMatch(HardMediumSoftScoreHolder.java:69)
at
org.optaplanner.examples.tennis.solver.Rule_fairAssignmentCountPerTeam1005511081.defaultConsequence(Rule_fairAssignmentCountPerTeam1005511081.java:21)
at
org.optaplanner.examples.tennis.solver.Rule_fairAssignmentCountPerTeam1005511081DefaultConsequenceInvokerGenerated.evaluate(Unknown
Source)
at
org.optaplanner.examples.tennis.solver.Rule_fairAssignmentCountPerTeam1005511081DefaultConsequenceInvoker.evaluate(Unknown
Source)
at org.drools.core.phreak.RuleExecutor.innerFireActivation(RuleExecutor.java:431)
... 38 more
{code}
See also related discussion in:
https://groups.google.com/forum/#!topic/optaplanner-dev/xA6IdGieDpU
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)