[jboss-jira] [JBoss JIRA] Updated: (JBRULES-1770) IndexOutOfBoundsException with subflows while removing listener from RuleFlowEventSupport

Richard bedard (JIRA) jira-events at lists.jboss.org
Wed Sep 17 14:03:21 EDT 2008


     [ https://jira.jboss.org/jira/browse/JBRULES-1770?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard bedard updated JBRULES-1770:
------------------------------------

    Description: 
I have 9 ruleFlows, A, B and C  and 6 others
A is the main one that include B as a subflow and 6 others, B include C as a subflow

When RuleFlowEventSupport.fireRuleFlowProcessCompleted is called, the listeners list contains 8 elements, 1 per sub ruleflow.
The size of the list is set in a variable "size" for performance i guess:

for ( int i = 0, size = this.listeners.size(); i < size; i++ ) {

But somehow, i didn't check the reason, the method removeEventListener is called and the list size is now 7, so im
having an java.lang.IndexOutOfBoundsException.

This appen when the subflow C isn't changing the working memory(no insert, modify or remove), when an object is inserted, 
there is no error... I've tried with and without shadow fact "setShadowProxy( false/true );"

Object removed:

listener	RuleFlowProcessInstanceImpl  (id=7454)	
	id		2	
	nodeInstances	ArrayList<E>  (id=7749)	
	process		RuleFlowProcessImpl  (id=7750)	
	state		2	
	workingMemory	ReteooStatefulSession  (id=7444)	


Stack that show the object removing while iterating on the list:

RuleFlowEventSupport.removeEventListener(RuleFlowEventListener) line: 48	<----- A listener is removed here
ReteooStatefulSession(AbstractWorkingMemory).removeEventListener(RuleFlowEventListener) line: 306	
RuleFlowProcessInstanceImpl.setState(int) line: 184	
EndNodeInstanceImpl.trigger(RuleFlowNodeInstance) line: 30	
RuleFlowJoinInstanceImpl.triggerCompleted() line: 89	
RuleFlowJoinInstanceImpl.checkActivation() line: 85	
RuleFlowJoinInstanceImpl.trigger(RuleFlowNodeInstance) line: 59	
SubFlowNodeInstanceImpl.triggerCompleted() line: 51	
RuleFlowProcessInstanceImpl.ruleFlowCompleted(RuleFlowCompletedEvent, WorkingMemory) line: 262	
RuleFlowEventSupport.fireRuleFlowProcessCompleted(RuleFlowProcessInstance, InternalWorkingMemory) line: 86	<--- Iterating on the listeners list here
RuleFlowProcessInstanceImpl.setState(int) line: 185	
EndNodeInstanceImpl.trigger(RuleFlowNodeInstance) line: 30	
RuleFlowJoinInstanceImpl.triggerCompleted() line: 89	
RuleFlowJoinInstanceImpl.checkActivation() line: 85	
RuleFlowJoinInstanceImpl.trigger(RuleFlowNodeInstance) line: 59	
RuleFlowGroupImpl(RuleFlowSequenceNodeInstanceImpl).triggerCompleted() line: 38	
RuleFlowGroupImpl.setActive(boolean) line: 103	
RuleFlowGroupImpl$DeactivateCallback.execute(InternalWorkingMemory) line: 211	
ReteooStatefulSession(AbstractWorkingMemory).executeQueuedActions() line: 1312	
ReteooStatefulSession(AbstractWorkingMemory).fireAllRules(AgendaFilter, int) line: 467	
ReteooStatefulSession(AbstractWorkingMemory).fireAllRules() line: 439	
DroolsStdImpl.executeRulesEngine(List<Object>, String) line: 100	


  was:
I have 9 ruleFlows, A, B and C  and 6 others
A is the main one that include B as a subflow and 6 others, B include C as a subflow

When RuleFlowEventSupport.fireRuleFlowProcessCompleted is called, the listeners list contains 8 elements, 1 per sub ruleflow.
The size of the list is set in a variable "i" for performance i guess:

for ( int i = 0, size = this.listeners.size(); i < size; i++ ) {

But somehow, i didn't check the reason, the method removeEventListener is called and the list size is now 7, so im
having an java.lang.IndexOutOfBoundsException.

This appen when the subflow C isn't changing the working memory(no insert, modify or remove), when an object is inserted, 
there is no error... I've tried with and without shadow fact "setShadowProxy( false/true );"

Object removed:

listener	RuleFlowProcessInstanceImpl  (id=7454)	
	id		2	
	nodeInstances	ArrayList<E>  (id=7749)	
	process		RuleFlowProcessImpl  (id=7750)	
	state		2	
	workingMemory	ReteooStatefulSession  (id=7444)	


Stack that show the object removing while iterating on the list:

RuleFlowEventSupport.removeEventListener(RuleFlowEventListener) line: 48	<----- A listerner is removed here
ReteooStatefulSession(AbstractWorkingMemory).removeEventListener(RuleFlowEventListener) line: 306	
RuleFlowProcessInstanceImpl.setState(int) line: 184	
EndNodeInstanceImpl.trigger(RuleFlowNodeInstance) line: 30	
RuleFlowJoinInstanceImpl.triggerCompleted() line: 89	
RuleFlowJoinInstanceImpl.checkActivation() line: 85	
RuleFlowJoinInstanceImpl.trigger(RuleFlowNodeInstance) line: 59	
SubFlowNodeInstanceImpl.triggerCompleted() line: 51	
RuleFlowProcessInstanceImpl.ruleFlowCompleted(RuleFlowCompletedEvent, WorkingMemory) line: 262	
RuleFlowEventSupport.fireRuleFlowProcessCompleted(RuleFlowProcessInstance, InternalWorkingMemory) line: 86	<--- Iterating on the listeners list here
RuleFlowProcessInstanceImpl.setState(int) line: 185	
EndNodeInstanceImpl.trigger(RuleFlowNodeInstance) line: 30	
RuleFlowJoinInstanceImpl.triggerCompleted() line: 89	
RuleFlowJoinInstanceImpl.checkActivation() line: 85	
RuleFlowJoinInstanceImpl.trigger(RuleFlowNodeInstance) line: 59	
RuleFlowGroupImpl(RuleFlowSequenceNodeInstanceImpl).triggerCompleted() line: 38	
RuleFlowGroupImpl.setActive(boolean) line: 103	
RuleFlowGroupImpl$DeactivateCallback.execute(InternalWorkingMemory) line: 211	
ReteooStatefulSession(AbstractWorkingMemory).executeQueuedActions() line: 1312	
ReteooStatefulSession(AbstractWorkingMemory).fireAllRules(AgendaFilter, int) line: 467	
ReteooStatefulSession(AbstractWorkingMemory).fireAllRules() line: 439	
DroolsStdImpl.executeRulesEngine(List<Object>, String) line: 100	




> IndexOutOfBoundsException with subflows while removing listener from RuleFlowEventSupport
> -----------------------------------------------------------------------------------------
>
>                 Key: JBRULES-1770
>                 URL: https://jira.jboss.org/jira/browse/JBRULES-1770
>             Project: JBoss Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Rule Flow
>    Affects Versions: 4.0.7
>         Environment: MyEclipse Blue, Windows XP, 
>            Reporter: Richard bedard
>            Assignee: Mark Proctor
>
> I have 9 ruleFlows, A, B and C  and 6 others
> A is the main one that include B as a subflow and 6 others, B include C as a subflow
> When RuleFlowEventSupport.fireRuleFlowProcessCompleted is called, the listeners list contains 8 elements, 1 per sub ruleflow.
> The size of the list is set in a variable "size" for performance i guess:
> for ( int i = 0, size = this.listeners.size(); i < size; i++ ) {
> But somehow, i didn't check the reason, the method removeEventListener is called and the list size is now 7, so im
> having an java.lang.IndexOutOfBoundsException.
> This appen when the subflow C isn't changing the working memory(no insert, modify or remove), when an object is inserted, 
> there is no error... I've tried with and without shadow fact "setShadowProxy( false/true );"
> Object removed:
> listener	RuleFlowProcessInstanceImpl  (id=7454)	
> 	id		2	
> 	nodeInstances	ArrayList<E>  (id=7749)	
> 	process		RuleFlowProcessImpl  (id=7750)	
> 	state		2	
> 	workingMemory	ReteooStatefulSession  (id=7444)	
> Stack that show the object removing while iterating on the list:
> RuleFlowEventSupport.removeEventListener(RuleFlowEventListener) line: 48	<----- A listener is removed here
> ReteooStatefulSession(AbstractWorkingMemory).removeEventListener(RuleFlowEventListener) line: 306	
> RuleFlowProcessInstanceImpl.setState(int) line: 184	
> EndNodeInstanceImpl.trigger(RuleFlowNodeInstance) line: 30	
> RuleFlowJoinInstanceImpl.triggerCompleted() line: 89	
> RuleFlowJoinInstanceImpl.checkActivation() line: 85	
> RuleFlowJoinInstanceImpl.trigger(RuleFlowNodeInstance) line: 59	
> SubFlowNodeInstanceImpl.triggerCompleted() line: 51	
> RuleFlowProcessInstanceImpl.ruleFlowCompleted(RuleFlowCompletedEvent, WorkingMemory) line: 262	
> RuleFlowEventSupport.fireRuleFlowProcessCompleted(RuleFlowProcessInstance, InternalWorkingMemory) line: 86	<--- Iterating on the listeners list here
> RuleFlowProcessInstanceImpl.setState(int) line: 185	
> EndNodeInstanceImpl.trigger(RuleFlowNodeInstance) line: 30	
> RuleFlowJoinInstanceImpl.triggerCompleted() line: 89	
> RuleFlowJoinInstanceImpl.checkActivation() line: 85	
> RuleFlowJoinInstanceImpl.trigger(RuleFlowNodeInstance) line: 59	
> RuleFlowGroupImpl(RuleFlowSequenceNodeInstanceImpl).triggerCompleted() line: 38	
> RuleFlowGroupImpl.setActive(boolean) line: 103	
> RuleFlowGroupImpl$DeactivateCallback.execute(InternalWorkingMemory) line: 211	
> ReteooStatefulSession(AbstractWorkingMemory).executeQueuedActions() line: 1312	
> ReteooStatefulSession(AbstractWorkingMemory).fireAllRules(AgendaFilter, int) line: 467	
> ReteooStatefulSession(AbstractWorkingMemory).fireAllRules() line: 439	
> DroolsStdImpl.executeRulesEngine(List<Object>, String) line: 100	

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list