[
https://jira.jboss.org/jira/browse/JBPM-2703?page=com.atlassian.jira.plug...
]
Maciej Swiderski updated JBPM-2703:
-----------------------------------
Attachment: jbpm-2703-extended.patch
Attaching patch that is a bit simplified if it comes to test case. Since it requires a
class (compiled) one o deployment time but it must be excluded from class path when
running the test, class is created and compiled on runtime. So no additional folders need
to be created.
Please let me know what do you think about the solution.
If you apply only the patch for test case you could easily see that it will fail with
change only to use context class loader.
Patch file name: jbpm-2703-extended.patch
Deserialization fails to work using custom Classloader
------------------------------------------------------
Key: JBPM-2703
URL:
https://jira.jboss.org/jira/browse/JBPM-2703
Project: jBPM
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Runtime Engine
Affects Versions: jBPM 4.2
Reporter: Nicolas Leroux
Assignee: Maciej Swiderski
Fix For: jBPM 4.4
Attachments: jbpm-2703-extended.patch, jbpm-2703.patch
I am trying to use jBPM outside a servlet container and when storing a variable in the
execution context, retrieving it I have:
Caught: java.lang.ClassNotFoundException: Blah
This is the same bug as described in:
http://jira.codehaus.org/browse/GROOVY-1627 . I think this is the following issue as
well:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4340158 .
{quote}Java uses the last defined ClassLoader to loader the class. In many environments
this might mean that the wrong class loader is chosen or that it works one day and the
other day not. {quote}
The following code fixes the problem (in
org.jbpm.pvm.internal.type.converter.SerializableToBytesConverter line 71 in the revert
method:
{code}
ObjectInputStream ois = new ObjectInputStream(bais) {
protected Class resolveClass(ObjectStreamClass objectStreamClass) throws IOException,
ClassNotFoundException {
return Class.forName(objectStreamClass.getName(), true,
Thread.currentThread().getContextClassLoader());
}
};
{code}
--
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