Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-7614

PhreakAccumulateNode trigger "accctx" NullPointerException when fireAllRules

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Blocker Blocker
    • None
    • 7.74.1.Final, 8.44.0.Final, 9.44.0.Alpha
    • core engine
    • None
    • Hide

      1.To reproduce, run the use case tests in attached projects, then see the error message.

      The "accctx"NullPointerException happened in both Drools 7.74.1.Final, 8.44.0.Final  and 9.44.0.Final as test shows, think the new Drools 9+ still has the issues.

       

      java.lang.NullPointerException: Cannot invoke "org.drools.core.reteoo.AccumulateNode$BaseAccumulation.setPropagationContext(org.drools.core.common.PropagationContext)" because "accctx" is null
      
        at org.drools.core.phreak.PhreakAccumulateNode.addMatch(PhreakAccumulateNode.java:728) at org.drools.core.phreak.PhreakAccumulateNode.doRightUpdatesProcessChildren(PhreakAccumulateNode.java:486) at org.drools.core.phreak.PhreakAccumulateNode.doRightUpdates(PhreakAccumulateNode.java:445) at org.drools.core.phreak.PhreakAccumulateNode.doNode(PhreakAccumulateNode.java:74) at org.drools.core.phreak.RuleNetworkEvaluator.switchOnDoBetaNode(RuleNetworkEvaluator.java:595) at org.drools.core.phreak.RuleNetworkEvaluator.evalBetaNode(RuleNetworkEvaluator.java:562) at org.drools.core.phreak.RuleNetworkEvaluator.evalNode(RuleNetworkEvaluator.java:389) at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:349) at org.drools.core.phreak.RuleNetworkEvaluator.evalStackEntry(RuleNetworkEvaluator.java:247) at org.drools.core.phreak.RuleNetworkEvaluator.outerEval(RuleNetworkEvaluator.java:190) at org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(RuleNetworkEvaluator.java:143) at org.drools.core.phreak.RuleExecutor.evaluateNetwork(RuleExecutor.java:221) at org.drools.kiesession.agenda.DefaultAgenda.evaluateEagerList(DefaultAgenda.java:501) at org.drools.core.phreak.RuleExecutor.haltRuleFiring(RuleExecutor.java:270) at org.drools.core.phreak.RuleExecutor.fire(RuleExecutor.java:167) at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:83) at org.drools.core.concurrent.AbstractGroupEvaluator.evaluateAndFire(AbstractGroupEvaluator.java:46) at org.drools.kiesession.agenda.DefaultAgenda.fireLoop(DefaultAgenda.java:624) at org.drools.kiesession.agenda.DefaultAgenda.internalFireAllRules(DefaultAgenda.java:571) at org.drools.kiesession.agenda.DefaultAgenda.fireAllRules(DefaultAgenda.java:563) at org.drools.kiesession.session.StatefulKnowledgeSessionImpl.internalFireAllRules(StatefulKnowledgeSessionImpl.java:1088) at org.drools.kiesession.session.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1079) at org.drools.kiesession.session.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1063) at com.sample.ProductsRuleTest.test(ProductsRuleTest.java:89) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) 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:69) at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38) at 
       
       

       

       

      2.One thing to mention: when the test run in 7.73.0.Final and 7.68.0.Final, it reports followings exceptions messages, 

      think it already been fixed in https://issues.redhat.com/browse/DROOLS-7420
       

      java.lang.NullPointerException: Cannot invoke "org.drools.core.spi.Tuple.setStagedNext(org.drools.core.spi.Tuple)" because "tuple" is null   at org.drools.core.common.TupleSetsImpl.setNextTuple(TupleSetsImpl.java:349) at org.drools.core.common.TupleSetsImpl.removeUpdate(TupleSetsImpl.java:205) at org.drools.core.phreak.RuleNetworkEvaluator.doRiaNode2(RuleNetworkEvaluator.java:708) at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:334)
      ......

       3. if the tests run in Drools versions before 7.62.0.Final, it totally works ok, no exception message.
       

      Show
      1.To reproduce, run the use case tests in attached projects, then see the error message. The "accctx"NullPointerException happened in both Drools 7.74.1.Final, 8.44.0.Final  and 9.44.0.Final as test shows, think the new Drools 9+ still has the issues.   java.lang.NullPointerException: Cannot invoke "org.drools.core.reteoo.AccumulateNode$BaseAccumulation.setPropagationContext(org.drools.core.common.PropagationContext)" because "accctx" is null   at org.drools.core.phreak.PhreakAccumulateNode.addMatch(PhreakAccumulateNode.java:728) at org.drools.core.phreak.PhreakAccumulateNode.doRightUpdatesProcessChildren(PhreakAccumulateNode.java:486) at org.drools.core.phreak.PhreakAccumulateNode.doRightUpdates(PhreakAccumulateNode.java:445) at org.drools.core.phreak.PhreakAccumulateNode.doNode(PhreakAccumulateNode.java:74) at org.drools.core.phreak.RuleNetworkEvaluator.switchOnDoBetaNode(RuleNetworkEvaluator.java:595) at org.drools.core.phreak.RuleNetworkEvaluator.evalBetaNode(RuleNetworkEvaluator.java:562) at org.drools.core.phreak.RuleNetworkEvaluator.evalNode(RuleNetworkEvaluator.java:389) at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:349) at org.drools.core.phreak.RuleNetworkEvaluator.evalStackEntry(RuleNetworkEvaluator.java:247) at org.drools.core.phreak.RuleNetworkEvaluator.outerEval(RuleNetworkEvaluator.java:190) at org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(RuleNetworkEvaluator.java:143) at org.drools.core.phreak.RuleExecutor.evaluateNetwork(RuleExecutor.java:221) at org.drools.kiesession.agenda.DefaultAgenda.evaluateEagerList(DefaultAgenda.java:501) at org.drools.core.phreak.RuleExecutor.haltRuleFiring(RuleExecutor.java:270) at org.drools.core.phreak.RuleExecutor.fire(RuleExecutor.java:167) at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:83) at org.drools.core.concurrent.AbstractGroupEvaluator.evaluateAndFire(AbstractGroupEvaluator.java:46) at org.drools.kiesession.agenda.DefaultAgenda.fireLoop(DefaultAgenda.java:624) at org.drools.kiesession.agenda.DefaultAgenda.internalFireAllRules(DefaultAgenda.java:571) at org.drools.kiesession.agenda.DefaultAgenda.fireAllRules(DefaultAgenda.java:563) at org.drools.kiesession.session.StatefulKnowledgeSessionImpl.internalFireAllRules(StatefulKnowledgeSessionImpl.java:1088) at org.drools.kiesession.session.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1079) at org.drools.kiesession.session.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1063) at com.sample.ProductsRuleTest.test(ProductsRuleTest.java:89) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) 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:69) at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38) at       2.One thing to mention: when the test run in 7.73.0.Final and 7.68.0.Final, it reports followings exceptions messages,  think it already been fixed in https://issues.redhat.com/browse/DROOLS-7420   java.lang.NullPointerException: Cannot invoke "org.drools.core.spi.Tuple.setStagedNext(org.drools.core.spi.Tuple)" because "tuple" is null   at org.drools.core.common.TupleSetsImpl.setNextTuple(TupleSetsImpl.java:349) at org.drools.core.common.TupleSetsImpl.removeUpdate(TupleSetsImpl.java:205) at org.drools.core.phreak.RuleNetworkEvaluator.doRiaNode2(RuleNetworkEvaluator.java:708) at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:334) ......  3. if the tests run in Drools versions before 7.62.0.Final, it totally works ok, no exception message.  
    • NEW
    • NEW
    • ---
    • ---

       
      1. Create rules in 7.74.1.Final and 8.44.0.Final like attachments shows.
       
      2, Run the test in projects that attached, it will report followings Exception messages:
       
       
       

      java.lang.NullPointerException: Cannot invoke "org.drools.core.reteoo.AccumulateNode$BaseAccumulation.setPropagationContext(org.drools.core.common.PropagationContext)" because "accctx" is null
      
        at org.drools.core.phreak.PhreakAccumulateNode.addMatch(PhreakAccumulateNode.java:728) at org.drools.core.phreak.PhreakAccumulateNode.doRightUpdatesProcessChildren(PhreakAccumulateNode.java:486) at org.drools.core.phreak.PhreakAccumulateNode.doRightUpdates(PhreakAccumulateNode.java:445) at org.drools.core.phreak.PhreakAccumulateNode.doNode(PhreakAccumulateNode.java:74) at org.drools.core.phreak.RuleNetworkEvaluator.switchOnDoBetaNode(RuleNetworkEvaluator.java:595) at org.drools.core.phreak.RuleNetworkEvaluator.evalBetaNode(RuleNetworkEvaluator.java:562) at org.drools.core.phreak.RuleNetworkEvaluator.evalNode(RuleNetworkEvaluator.java:389) at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:349) at org.drools.core.phreak.RuleNetworkEvaluator.evalStackEntry(RuleNetworkEvaluator.java:247) at org.drools.core.phreak.RuleNetworkEvaluator.outerEval(RuleNetworkEvaluator.java:190) at org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(RuleNetworkEvaluator.java:143) at org.drools.core.phreak.RuleExecutor.evaluateNetwork(RuleExecutor.java:221) at org.drools.kiesession.agenda.DefaultAgenda.evaluateEagerList(DefaultAgenda.java:501) at org.drools.core.phreak.RuleExecutor.haltRuleFiring(RuleExecutor.java:270) at org.drools.core.phreak.RuleExecutor.fire(RuleExecutor.java:167) at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:83) at org.drools.core.concurrent.AbstractGroupEvaluator.evaluateAndFire(AbstractGroupEvaluator.java:46) at org.drools.kiesession.agenda.DefaultAgenda.fireLoop(DefaultAgenda.java:624) at org.drools.kiesession.agenda.DefaultAgenda.internalFireAllRules(DefaultAgenda.java:571) at org.drools.kiesession.agenda.DefaultAgenda.fireAllRules(DefaultAgenda.java:563) at org.drools.kiesession.session.StatefulKnowledgeSessionImpl.internalFireAllRules(StatefulKnowledgeSessionImpl.java:1088) at org.drools.kiesession.session.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1079) at org.drools.kiesession.session.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1063) at com.sample.ProductsRuleTest.test(ProductsRuleTest.java:89) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) 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:69) at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38) at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
       
        

        1. image-2024-03-14-09-22-47-841.png
          195 kB
          cris li

              mfusco@redhat.com Mario Fusco
              criswork cris li (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: