[rules-users] Fusion: Null pointer exception when using sliding windows

Davide Sottara dsotty at gmail.com
Thu Apr 18 16:56:55 EDT 2013


Thanks, reproduced.
I will raise a blocker JIRA
Davide

On 04/18/2013 12:28 PM, burmanator wrote:
> The missing ":" was just a typo in my transcribing. I'm running my code in a
> virtual machine so I couldn't copy and paste and have to hand type
> everything out.  I go through and check the knowledge builder for errors by
> checking the size of KnowledgeBuilder.getErrors() and if the size is greater
> then 0, display the error. However nothing comes up.
>
> I'm running Drools 5.5.0.Final that I just downloaded recently.
>
> the DRL I'm using consists of:
>
> package testing2;
>
> import test2.*; 
> import java.util.*;
> import org.drools.*;
>
> declare Foo
> @role(event)
> @timestamp(Start)
> @duration(Duration)
> end
>
> rule test
> when
> $primary : Foo($name : Name) over window:length(24)
> $prev : ArrayList(size<1) from collect ( Foo(Name == $name, this before
> $primary)) 
> then
> System.out.println("Found name: " + $name);
> end
>
>
> The error in the console that gets spit back out is:
>
> java.land.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.AbstractWorkingMemory.insert
> (AbstractWorkingMemory.java : 903)
>    at org.drools.common.AbstractWorkingMemory.insert
> (AbstractWorkingMemory.java : 847)
>    at
> org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java
> : 269)
>    at test2.Engine2.main (ngine2.java : 78)
>
> that last line points to my main class where I add the events into the
> knowledge session.
>
> When I change "over window:length(24)" to "over window:time(21d)" (my sample
> data is about 22 days old now) I get the error:
>
> org.drools.RuntimeDroolsException : Unexpected exception executing action
> org.drools.rule.SlidingTimeWIndow$BehaviorExpireWMAction at 491cc367
>    at org.drools.common.AbstractWorkingMemory.executeQueuedActions
> (AbstractWorkingMemory.java : 995)
>    at org.drools.common.NamedEntryPoint.insert (NamedEntryPoint.java : 362)
>    at org.drools.common.NamedEntryPoint.insert (NamedEntryPoint.jaba : 311)
>    at org.drools.common.AbstractWorkingMemory.insert
> (AbstractWorkingMemory.java : 903)
>    at org.drools.common.AbstractWorkingMemory.insert
> (AbstractWorkingMemory.java : 847)
>    at org.drools.impl.StatefulKnowledgeSessionImpl.insert
> (StatefulKnowledgeSessionImpl.java : 269)
>    at test2.Engine2.main (Engine2.java : 78)
> 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)
> ... 6 more
>
>
> When I get rid of any over window statements, everything runs just fine.
>
>
>
> --
> View this message in context: http://drools.46999.n3.nabble.com/Fusion-Null-pointer-exception-when-using-sliding-windows-tp4023410p4023426.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



More information about the rules-users mailing list