-
Bug
-
Resolution: Done
-
Minor
-
jBPM 3.2.x
-
None
-
None
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:
<?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>
The stack trace
javax.servlet.ServletException: Servlet execution threw an exception org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
root cause
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)
(Etc, etc)