Bug 724701 (BRMS-580) - AccumulateNode runs into NPE
Summary: AccumulateNode runs into NPE
Keywords:
Status: CLOSED NEXTRELEASE
Alias: BRMS-580
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRE (Expert, Fusion)
Version: 5.1.0 GA,5.1.0.PostGA
Hardware: Unspecified
OS: Unspecified
urgent
unspecified
Target Milestone: ---
: 5.1.0.PostGA
Assignee: Tihomir Surdilovic
QA Contact:
URL: http://jira.jboss.org/jira/browse/BRM...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-04-12 18:25 UTC by Alessandro Lazarotti
Modified: 2011-04-14 21:48 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-04-14 21:48:10 UTC
Type: Bug


Attachments (Terms of Use)
DroolsTest.java (5.35 KB, text/x-java)
2011-04-12 18:25 UTC, Alessandro Lazarotti
no flags Details
JB2887.zip (6.85 KB, application/zip)
2011-04-12 18:25 UTC, Alessandro Lazarotti
no flags Details
SampleAlarmRules.drl (5.39 KB, application/octet-stream)
2011-04-12 18:25 UTC, Alessandro Lazarotti
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker BRMS-580 0 Critical Closed AccumulateNode runs into NPE 2013-02-06 07:32:26 UTC

Description Alessandro Lazarotti 2011-04-12 18:25:23 UTC
Help Desk Ticket Reference: https://c.na7.visual.force.com/apex/Case_View?id=500A00000078xLk&sfdc.override=1
Steps to Reproduce: Execute the project JB2887.zip attached with this Jira case
securitylevel_name: Public

A rule such as
rule "MESSAGE_FINE"
salience 2
	when
		
		Message (value == "FINE")
		
		$listHolder : ListHolder()
				
		$coll1:ArrayList()
              from collect(Object() from $listHolder.getList())      
		$coll2:ArrayList()
              from collect(Object() from $listHolder.getList())
	then
	System.out.println("Exceuting rule");	
end

rule "MESSAGE_HELLO"
salience 1
	when
		msg : Message(value != "HELLO" )
	then
		msg.setValue("HELLO");
		update(msg);
		System.out.println("Message: "+msg.getValue());		
end

runs into a NPE

Caused by: java.lang.NullPointerException
	at org.drools.reteoo.AccumulateNode.getFirstMatch(AccumulateNode.java:967)
	at org.drools.reteoo.AccumulateNode.splitList(AccumulateNode.java:920)
	at org.drools.reteoo.AccumulateNode.removePreviousMatchesForLeftTuple(AccumulateNode.java:874)
	at org.drools.reteoo.AccumulateNode.retractLeftTuple(AccumulateNode.java:205)
	at org.drools.reteoo.CompositeLeftTupleSinkAdapter.doPropagateRetractLeftTuple(CompositeLeftTupleSinkAdapter.java:238)
	at org.drools.reteoo.CompositeLeftTupleSinkAdapter.propagateRetractLeftTupleDestroyRightTuple(CompositeLeftTupleSinkAdapter.java:138)
	at org.drools.reteoo.AccumulateNode.retractLeftTuple(AccumulateNode.java:212)
	at org.drools.reteoo.ModifyPreviousTuples.retractTuples(ModifyPreviousTuples.java:111)
	at org.drools.reteoo.EntryPointNode.modifyObject(EntryPointNode.java:176)
	at org.drools.common.NamedEntryPoint.update(NamedEntryPoint.java:450)
	at org.drools.common.NamedEntryPoint.update(NamedEntryPoint.java:361)
	at org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:183)
	at org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:196)
	at event.Rule_launch_0.defaultConsequence(Rule_launch_0.java:7)
	at event.Rule_launch_0DefaultConsequenceInvoker.evaluate(Rule_launch_0DefaultConsequenceInvoker.java:33)
	at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:913)


A null Parameter accctx is passed down from retractLeftTuple.

Comment 1 Alessandro Lazarotti 2011-04-12 18:25:23 UTC
Link: Added: This issue Cloned from JBRULES-2887


Comment 2 Alessandro Lazarotti 2011-04-12 18:31:29 UTC
Help Desk Ticket Reference: Added: https://c.na7.visual.force.com/apex/Case_View?id=500A00000078xLk&sfdc.override=1
Steps to Reproduce: Removed: Notice that the initial pattern B(...) is essential for reproducing the issue, because it is this pattern terminating the match that triggers the NPE. Added: Execute the project JB2887.zip attached with this Jira case


Comment 3 Alessandro Lazarotti 2011-04-12 18:41:59 UTC
the same project works in BRMS 5.0.x

Comment 4 Tihomir Surdilovic 2011-04-14 21:47:57 UTC
merged changes into the BRMS 5.1.x branch


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