[jboss-jira] [JBoss JIRA] (DROOLS-138) AccumulateNode throws NPE

Jason Barto (JIRA) jira-events at lists.jboss.org
Wed May 15 19:09:06 EDT 2013


    [ https://issues.jboss.org/browse/DROOLS-138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12774599#comment-12774599 ] 

Jason Barto commented on DROOLS-138:
------------------------------------

Davide, thank for your feedback. Your suggestions about writing better rules are very helpful. This jira came out of a quick and dirty test I conducted in an effort to assess Drools fitness for my purposes; prior to investing a proper amount of time into learning the language. What you said about the 2rules being out of synch... Would I use something like a rule flow group to synch them up? http://docs.jboss.org/drools/release/5.3.0.Final/drools-expert-docs/html/ch05.html#d0e3850

Also can you help me to understand better how sending events into the system with only microseconds between events could induce lossy behavior? Is there an article on such behavior anywhere?
                
> AccumulateNode throws NPE
> -------------------------
>
>                 Key: DROOLS-138
>                 URL: https://issues.jboss.org/browse/DROOLS-138
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 5.5.1.Final
>         Environment: ### OS ###
> Darwin <hostname redacted> 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64
> ### Java Version ###
> java version "1.6.0_45"
> Java(TM) SE Runtime Environment (build 1.6.0_45-b06-451-11M4406)
> Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01-451, mixed mode)
>            Reporter: Jason Barto
>            Assignee: Mark Proctor
>            Priority: Minor
>
> AccumulateNode throws a NPE when events are inserted too quickly via an entry-point.  A stateful knowledge session to which events are inserted and running an accumulate on the input events.  I have a for loop generating the events and inserting them as rapidly as possible.  In the rules I use an accumulator to calculate the average of the values contained within the events.  The behavior I'm observing is that if I insert ~120 events without any waiting I receive an NPE.  If I Thread.sleep for even just 1ms the test goes off without a hitch.  
> The NPE is as follows:
> Exception in thread "main" java.lang.NullPointerException
>         at org.drools.reteoo.AccumulateNode.getFirstMatch(AccumulateNode.java:1050)
>         at org.drools.reteoo.AccumulateNode.modifyLeftTuple(AccumulateNode.java:345)
>         at org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateModifyChildLeftTuple(SingleLeftTupleSinkAdapter.java:259)
>         at org.drools.reteoo.AccumulateNode.evaluateResultConstraints(AccumulateNode.java:676)
>         at org.drools.reteoo.ReteooWorkingMemory$EvaluateResultConstraints.execute(ReteooWorkingMemory.java:590)
>         at org.drools.common.PropagationContextImpl.evaluateActionQueue(PropagationContextImpl.java:350)
>         at org.drools.rule.SlidingLengthWindow.assertFact(SlidingLengthWindow.java:119)
>         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)
>         at drools5fusioneval.Average.main(Average.java:66)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list