Bug 724631 (BRMS-538) - Fix for BRMS-519
Summary: Fix for BRMS-519
Keywords:
Status: CLOSED NEXTRELEASE
Alias: BRMS-538
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRE (Expert, Fusion)
Version: 5.1.0 GA
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: ---
: One Off Releases
Assignee: Matt Davis
QA Contact:
URL: http://jira.jboss.org/jira/browse/BRM...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-01-19 19:01 UTC by Matt Davis
Modified: 2011-06-07 19:26 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-16 15:12:23 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 724607 0 high CLOSED NullPointer in retractLeftTuple() 2021-02-22 00:41:40 UTC
Red Hat Issue Tracker BRMS-538 0 None Closed Fix for BRMS-519 2012-03-27 20:58:49 UTC
Red Hat Issue Tracker JBRULES-2810 0 None Closed NullPointerException in Drools 5.1.1 - retractLeftTuple() 2012-03-27 20:58:49 UTC
Red Hat Issue Tracker SOA-2815 0 None Closed Fix for BRMS-519 for SOA branch 2012-03-27 20:58:49 UTC

Internal Links: 724607

Description Matt Davis 2011-01-19 19:01:33 UTC
Help Desk Ticket Reference: https://c.na7.visual.force.com/apex/Case_View?id=500A0000005fJq7&sfdc.override=1
securitylevel_name: Public

We recently switched to Drools 5.1.1 and BRMS 5.1.0 GA in our testing environments, and we are seeing a NullPointerException on a number of rule base / test case combinations. These all worked fine in 5.0.1.

The rule in question is relatively simple, but the rule base is complex.
It's difficult to send a test case, because the exception appears to occur only in large rule bases and layered rule flows.

We have had to roll back to Drools 5.0.1 and are unable to adopt 5.1.1 until this is resolved.


The relevant stack trace info is below.


com.test.ARGenT.Execution.ARGenTRunTimeException - org.drools.runtime.rule.ConsequenceException: rule: RS7673.1.3_RF6365_83_50011728
...

Caused by:
rule: RS7673.1.3_RF6365_83_50011728
at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:927)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:856)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1071)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:785)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:751)
at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:218)
...

Caused by:
null
at org.drools.reteoo.RightInputAdapterNode.retractLeftTuple(RightInputAdapterNode.java:154)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateRetractLeftTuple(SingleLeftTupleSinkAdapter.java:217)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateRetractRightTuple(SingleLeftTupleSinkAdapter.java:124)
at org.drools.reteoo.JoinNode.retractRightTuple(JoinNode.java:151)
at org.drools.reteoo.ModifyPreviousTuples.retractTuples(ModifyPreviousTuples.java:132)
at org.drools.reteoo.EntryPointNode.modifyObject(EntryPointNode.java:176)
at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1442)
at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1349)
at org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:183)
at org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:196)
at com.test.GeneratedRules.Rule_RS7673_1_3_RF6365_83_50011728_0.defaultConsequence(Rule_RS7673_1_3_RF6365_83_50011728_0.java:9)
at com.test.GeneratedRules.Rule_RS7673_1_3_RF6365_83_50011728_0DefaultConsequenceInvoker.evaluate(Rule_RS7673_1_3_RF6365_83_50011728_0DefaultConsequenceInvoker.java:29)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:917)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:856)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1071)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:785)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:751)
at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:218)
...



The line identified in in the exception from retractLeftTuple is in the for loop, and it references factHandle without first checking for null:

        // retrieve handle from memory
        final InternalFactHandle factHandle = (InternalFactHandle) memory.remove( tuple );

 >>>>>> for ( RightTuple rightTuple = factHandle.getFirstRightTuple(); rightTuple != null; rightTuple = (RightTuple) rightTuple.getHandleNext() ) {
            rightTuple.getRightTupleSink().retractRightTuple( rightTuple,
                                                              context,
                                                              workingMemory );
        }
        factHandle.setFirstRightTuple( null );

Comment 1 Matt Davis 2011-01-19 19:02:31 UTC
Link: Added: This issue Cloned to BRMS-519


Comment 2 Matt Davis 2011-01-19 19:02:31 UTC
Link: Added: This issue Cloned to JBRULES-2810


Comment 4 Tihomir Surdilovic 2011-01-19 20:42:36 UTC
Assigning back to Matt

Comment 5 Lukáš Petrovický 2011-01-20 08:54:37 UTC
Jiri, please, test this.

Comment 6 Ryan Zhang 2011-01-20 08:56:18 UTC
The one off build is done. Please get it from http://jawa05.englab.brq.redhat.com/patches/BRMS-538/

Comment 7 Len DiMaggio 2011-01-20 15:16:35 UTC
Link: Added: This issue related SOA-2815


Comment 8 Jiri Locker 2011-01-21 12:58:53 UTC
The patched build has passed the added unit test case as well as the standard QE set of functional tests.

Assigning back to Matt.

Comment 9 Tihomir Surdilovic 2011-03-07 19:47:47 UTC
this one-off patch was never pushed to csp

Comment 10 Rick Wagner 2011-03-09 13:59:11 UTC
Patch is now available on the CSP.  

Comment 11 Len DiMaggio 2011-05-02 14:02:56 UTC
Closing - as the patch is on CSP.

Comment 12 Rick Wagner 2011-06-07 19:26:11 UTC
This patch superceded by BRMS-599, which includes code for BRMS-538 and BRMS-590.


Note You need to log in before you can comment on or make changes to this bug.