[jboss-jira] [JBoss JIRA] (JBRULES-3234) NPE while creating activations if a fact is modified by multiple prior consequences

Cyril Sochor (JIRA) jira-events at lists.jboss.org
Fri Feb 3 10:51:49 EST 2012


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

Cyril Sochor commented on JBRULES-3234:
---------------------------------------

I have same problem with drools 5.3.0Final and 5.4.0Beta2. My exception:

Exception in thread "Thread-4" org.drools.RuntimeDroolsException: Unexpected exception executing action org.drools.rule.SlidingTimeWindow$BehaviorExpireWMAction at 1161fded
        at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:977)
        at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:315)
        at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:291)
        at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:886)
        at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:845)
        at org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:255)
        at org.drools.runtime.pipeline.impl.StatefulKnowledgeSessionInsertStage.receive(StatefulKnowledgeSessionInsertStage.java:35)
        at org.drools.runtime.pipeline.impl.BaseEmitter.emit(BaseEmitter.java:47)
        at org.drools.runtime.pipeline.impl.JmsUnwrapMessageObject.receive(JmsUnwrapMessageObject.java:35)
        at org.drools.runtime.pipeline.impl.BaseEmitter.emit(BaseEmitter.java:47)
        at org.drools.runtime.pipeline.impl.StatefulKnowledgeSessionPipelineImpl.insert(StatefulKnowledgeSessionPipelineImpl.java:56)
        at org.drools.runtime.pipeline.impl.JmsMessenger$JmsMessengerRunner.run(JmsMessenger.java:149)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
        at org.drools.reteoo.RuleTerminalNode.createActivations(RuleTerminalNode.java:276)
        at org.drools.reteoo.RuleTerminalNode.modifyLeftTuple(RuleTerminalNode.java:326)
        at org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateModifyChildLeftTuple(SingleLeftTupleSinkAdapter.java:260)
        at org.drools.reteoo.AccumulateNode.evaluateResultConstraints(AccumulateNode.java:694)
        at org.drools.reteoo.ReteooWorkingMemory$EvaluateResultConstraints.execute(ReteooWorkingMemory.java:584)
        at org.drools.common.PropagationContextImpl.evaluateActionQueue(PropagationContextImpl.java:265)
        at org.drools.rule.SlidingTimeWindow.expireTuples(SlidingTimeWindow.java:182)
        at org.drools.rule.SlidingTimeWindow$BehaviorExpireWMAction.execute(SlidingTimeWindow.java:464)
        at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:975)
        ... 12 more

                
> NPE while creating activations if a fact is modified by multiple prior consequences 
> ------------------------------------------------------------------------------------
>
>                 Key: JBRULES-3234
>                 URL: https://issues.jboss.org/browse/JBRULES-3234
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: drools-core  (expert), drools-core (flow)
>    Affects Versions: 5.3.0.CR1
>            Reporter: Jamie Shaw
>            Assignee: Edson Tirelli
>            Priority: Critical
>             Fix For: 5.3.1.Final, 5.4.0.Beta1
>
>         Attachments: Drools runtimes.png, JBRULES-3234.zip, rulest.txt, Test output.txt
>
>
> I receive an NPE when attempting to modify a fact in a rule consequence if multiple prior rules have modified the same fact.
> It appears to involve the interaction between 3 rules, each of which is in a different agenda group.  For background, this is a fraud detection application.  Under certain conditions, we need to look up additional customer information.  Some rules are run to determine whether the lookup is required and then another rule actually does the lookup.  In this case:
> Rule 021 says if the order is small, set the lookup flag on the customer fact to false
> Rule 042B says if the order is from a 'bad' country, set the lookup flag on the customer fact to true
> Rule 022 says if the lookup flag is true, do the lookup, set the results on the customer flag and set the lookup flag on the customer fact
> If rule 021 fires alone, then 022 does not fire and all is well.
> If rule 042B fires alone, then 022 fires and all is well.
> If 021 fires to turn off the lookup AND 042B fires to turn on the lookup, then 022 gets and NPE.
> As Edson suspected, the item is null and the 'rule' variable points to rule 021.
> Each rule involved is in a different agenda group.
> This works in 5.2.0.Final, but breaks in 5.3.0.CR1.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list