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

NullPointerException at org.drools.core.common.LeftTupleSetsImpl.removeInsert(LeftTupleSetsImpl.java:141)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 6.4.0.Beta2
    • 6.3.0.Final
    • core engine
    • None

      The following NullPointerException occurs for the following rule:

      Exception in thread "main" java.lang.NullPointerException
      	at org.drools.core.common.LeftTupleSetsImpl.removeInsert(LeftTupleSetsImpl.java:141)
      	at org.drools.core.common.LeftTupleSetsImpl.addDelete(LeftTupleSetsImpl.java:80)
      	at org.drools.core.phreak.PhreakAccumulateNode.doLeftDeletes(PhreakAccumulateNode.java:603)
      	at org.drools.core.phreak.PhreakAccumulateNode.doNode(PhreakAccumulateNode.java:65)
      	at org.drools.core.phreak.RuleNetworkEvaluator.switchOnDoBetaNode(RuleNetworkEvaluator.java:565)
      	at org.drools.core.phreak.RuleNetworkEvaluator.evalBetaNode(RuleNetworkEvaluator.java:536)
      	at org.drools.core.phreak.RuleNetworkEvaluator.evalNode(RuleNetworkEvaluator.java:372)
      	at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:332)
      	at org.drools.core.phreak.RuleNetworkEvaluator.outerEval(RuleNetworkEvaluator.java:166)
      	at org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(RuleNetworkEvaluator.java:123)
      	at org.drools.core.phreak.RuleExecutor.reEvaluateNetwork(RuleExecutor.java:194)
      	at org.drools.core.phreak.RuleExecutor.fire(RuleExecutor.java:142)
      	at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:74)
      	at org.drools.core.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:978)
      	at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1292)
      	at org.drools.core.impl.StatefulKnowledgeSessionImpl.internalFireAllRules(StatefulKnowledgeSessionImpl.java:1294)
      	at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1281)
      	at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1260)
      	at org.drools.core.command.runtime.rule.FireAllRulesCommand.execute(FireAllRulesCommand.java:109)
      	at org.drools.core.command.runtime.rule.FireAllRulesCommand.execute(FireAllRulesCommand.java:34)
      	at org.drools.core.impl.StatelessKnowledgeSessionImpl.execute(StatelessKnowledgeSessionImpl.java:292)
      	at Test.main(Test.java:13)
      
      rule "test"
      when
          not( String() )
          accumulate(
              Long();
              sum(1)
          )
          ( Boolean() or not( Float() ) )
      then
          insert(new String());
      end
      

      (Please ignore the nonsensical rule; I simply couldn't reproduce this issue in any better way without providing you my larger system where the (more complex) rule makes more sense.)

      I'm using a default KIE configuration to load the rule:

      kmodule.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule" />
      

      Test.java:

      import org.kie.api.KieBase;
      import org.kie.api.KieServices;
      import org.kie.api.runtime.StatelessKieSession;
      import org.kie.internal.command.CommandFactory;
      
      public class Test {
      
          public static void main(String[] args) {
      
              KieBase kieBase = KieServices.Factory.get().getKieClasspathContainer()
                      .getKieBase();
              StatelessKieSession session = kieBase.newStatelessKieSession();
              session.execute(CommandFactory.newFireAllRules());
          }
      }
      

      This issue might be related with DROOLS-987.

              mfusco@redhat.com Mario Fusco
              cspurk Christian Spurk (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: