Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-3423

jBPM 3.2.x 2 allows user to deploy process instances with 2 nodes same name, stack trace isn't helpful

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • jBPM 3.2.12
    • jBPM 3.2.x
    • None
    • None
    • Hide

      Use a process like the one included above, deploy it.

      Show
      Use a process like the one included above, deploy it.

      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)

              marco.rietveld Marco Rietveld (Inactive)
              marco.rietveld Marco Rietveld (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: