Bug 781046 (SOA-3532) - jBPM 3.2.x 2 allows user to deploy process instances with 2 nodes same name, stack trace isn't helpful
Summary: jBPM 3.2.x 2 allows user to deploy process instances with 2 nodes same name, ...
Keywords:
Status: MODIFIED
Alias: SOA-3532
Product: JBoss Enterprise SOA Platform 4
Classification: JBoss
Component: unspecified
Version: 4.3 CP04 GA
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Mark Little
QA Contact: Matej Melko
URL: http://jira.jboss.org/jira/browse/SOA...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-10-28 21:03 UTC by Rick Wagner
Modified: 2022-01-05 05:22 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
All jBPM 3.2.x
Last Closed:
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBPM-3423 0 Minor Resolved jBPM 3.2.x 2 allows user to deploy process instances with 2 nodes same name, stack trace isn't helpful 2015-11-02 15:39:31 UTC
Red Hat Issue Tracker SOA-3532 0 Minor Closed jBPM 3.2.x 2 allows user to deploy process instances with 2 nodes same name, stack trace isn't helpful 2015-11-02 15:39:31 UTC

Description Rick Wagner 2011-10-28 21:03:35 UTC
Complexity: High
Help Desk Ticket Reference: https://c.na7.visual.force.com/apex/Case_View?id=500A0000008TN29&sfdc.override=1
Steps to Reproduce: Use a process like the one included above, deploy it.
project_key: SOA

If the user tries to deploy a Process definition where 2 nodes have the same name, an unhelpful stack trace results.

The recursion occurs due to the use of ArrayList.indexOf:
      int index = nodeCollection.getNodes().indexOf(this);
The indexOf method calls equals() on its parameter ("this" in this case).


Example:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<process-definition  xmlns=""  name="SimpleProcess">
	<start-state name="start-state1">
		<transition to="node1"></transition>
	</start-state>
	<node name="node1">
		<action class="com.sample.action.MessageActionHandler" name="Node1Action">
			<message>
				Hey I'm Node1
			</message>
		</action>
		<transition to="node"></transition>
	</node>
    <!--  Renamed this from 'node2' to see if recursion happens.... -->
	<node name="node1">
		<action class="com.sample.action.MessageActionHandler" name="Node2Action">
			<message>
				Hey I'm Node2
			</message>
		</action>
		<transition to="end-state1"></transition>
	</node>
	<end-state name="end-state1"></end-state>
</process-definition>
{code}

----
_*The stack trace*_

{noformat}
javax.servlet.ServletException: Servlet execution threw an exception
	org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
{noformat}

root cause

{noformat}
java.lang.StackOverflowError
	org.jbpm.graph.def.GraphElement.equals(GraphElement.java:442)
	java.util.ArrayList.indexOf(ArrayList.java:216)
	org.jbpm.graph.def.GraphElement.equals(GraphElement.java:457)
	java.util.ArrayList.indexOf(ArrayList.java:216)
	org.jbpm.graph.def.GraphElement.equals(GraphElement.java:457)
	java.util.ArrayList.indexOf(ArrayList.java:216)
	org.jbpm.graph.def.GraphElement.equals(GraphElement.java:457)
	java.util.ArrayList.indexOf(ArrayList.java:216)
	org.jbpm.graph.def.GraphElement.equals(GraphElement.java:457)
	java.util.ArrayList.indexOf(ArrayList.java:216)
	org.jbpm.graph.def.GraphElement.equals(GraphElement.java:457)
	java.util.ArrayList.indexOf(ArrayList.java:216)
	org.jbpm.graph.def.GraphElement.equals(GraphElement.java:457)
{noformat}
(Etc, etc)

Comment 1 (please assign to mrietvel@redhat.com) 2011-11-02 11:39:11 UTC
Complexity: Added: High


Comment 2 (please assign to mrietvel@redhat.com) 2011-11-02 11:41:10 UTC
Link: Added: This issue Cloned to JBPM-3423



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