[
http://jira.jboss.com/jira/browse/JBPM-1139?page=comments#action_12400015 ]
Wojciech Gdela commented on JBPM-1139:
--------------------------------------
I've noticed this in jbpm.3 HEAD code from yesterday, but this could also affect
previous versions of jBPM. The attached test will run after unpacking it in the jbpm.3
directory.
The ClassUtil class is not thread-safe
--------------------------------------
Key: JBPM-1139
URL:
http://jira.jboss.com/jira/browse/JBPM-1139
Project: JBoss jBPM
Issue Type: Bug
Components: Core Engine
Affects Versions: jBPM jPDL 3.2.3
Reporter: Wojciech Gdela
Assigned To: Tom Baeyens
Attachments: ClassUtil-concurrency-issue.zip
The ClassUtil class is not thread-safe. The exception will occur when two thread
simultanously try do deserialize variables from two different process definitions. Look at
the code:
{code}
public ContextObjectInputStream(final InputStream in,
ProcessInstance processInstance) throws IOException {
super(in);
this.setProcessInstance(processInstance);
ClassUtil.setProcessInstance(processInstance);
}
...
protected Class resolveClass(final ObjectStreamClass desc)
throws IOException, ClassNotFoundException {
return ClassUtil.forName(desc.getName(), ContextObjectInputStream.class);
}
...
ContextObjectInputStream cois = new ContextObjectInputStream(bais,
definition.createProcessInstance());
// when here another thread tries to execute the same code with another process instance
there will be a problem
return cois.readObject();
{/code}
Further description of issue is in attached test case.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira