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

NullPointerException in windows eviction

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Blocker
    • 5.5.1.Final, 6.0.0.CR2
    • 5.5.0.Final
    • None
    • None
    • Hide

      unpack attached maven project, run "mvn clean install", you should see a fialing test

      Show
      unpack attached maven project, run "mvn clean install", you should see a fialing test

    Description

      when writing a (fusion) rule with a length window and inserting more events than the window size drools produces a null pointer exception on the 1st event over the window size.

      the exception produced is:

      java.lang.NullPointerException
      at org.drools.core.util.index.RightTupleIndexHashTable.remove(RightTupleIndexHashTable.java:363)
      at org.drools.reteoo.AccumulateNode.retractRightTuple(AccumulateNode.java:318)
      at org.drools.rule.SlidingLengthWindow.assertFact(SlidingLengthWindow.java:116)
      at org.drools.rule.BehaviorManager.assertFact(BehaviorManager.java:94)
      at org.drools.reteoo.WindowNode.assertObject(WindowNode.java:167)
      at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:497)
      at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:382)
      at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)
      at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)
      at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:350)
      at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:311)
      at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:127)
      at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:55)

      a similar exception happens when the rule is re-written to use a time window (and the test updated to overflow that window):

      org.drools.RuntimeDroolsException: Unexpected exception executing action org.drools.rule.SlidingTimeWindow$BehaviorExpireWMAction@1dc39fc3
      at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:995)
      at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:335)
      at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:311)
      at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:127)
      at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:55)
      at TestBug2.testBug(TestBug2.java:96)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
      at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
      at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
      at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
      at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76)
      at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
      at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
      Caused by: java.lang.NullPointerException
      at org.drools.core.util.index.RightTupleIndexHashTable.remove(RightTupleIndexHashTable.java:363)
      at org.drools.reteoo.AccumulateNode.retractRightTuple(AccumulateNode.java:318)
      at org.drools.rule.SlidingTimeWindow.expireFacts(SlidingTimeWindow.java:189)
      at org.drools.rule.SlidingTimeWindow$BehaviorExpireWMAction.execute(SlidingTimeWindow.java:471)
      at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:993)
      ... 31 more

      Attachments

        Activity

          People

            mfusco@redhat.com Mario Fusco
            hatchetman82 Radai Rosenblatt (Inactive)
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: