SourceForge.net
2006-06-10 23:22:45 UTC
Feature Requests item #982260, was opened at 2004-06-30 07:09
Message generated for change (Comment added) made by tanderson
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=474139&aid=982260&group_id=54559
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: enhancement
Group: None
Submitted By: Johnathan Conley (jconley)
Initial Comment:
If OpenJMS is used in an Embedded system where the
classloaders are controlled through
Thread.currentThread().setContextClassloader(), it is
not able to properly deserialize object messages in
ObjectMessageImpl because it uses the default
implementation of ObjectInputStream.
Javadocs state that if you want to expand the
classloader capability, you need to extend the
resolveClass method yourself.
You would need to do something like the following:
protected Class resolveClass(ObjectStreamClass desc)
throws IOException, ClassNotFoundException {
ClassLoader cl =
Thread.currentThread().getContextClassLoader();
if (cl!=null)
return cl.loadClass(desc.getName());
return super.resolveClass(desc);
}
----------------------------------------------------------------------
Message:
Logged In: YES
user_id=557161
Support added in CVS. Will be available in 0.7.7-beta-1
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=474139&aid=982260&group_id=54559
Message generated for change (Comment added) made by tanderson
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=474139&aid=982260&group_id=54559
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: enhancement
Group: None
Status: Closed
Priority: 5Submitted By: Johnathan Conley (jconley)
Assigned to: Tim Anderson (tanderson)
Summary: support for context classloader during deserializationInitial Comment:
If OpenJMS is used in an Embedded system where the
classloaders are controlled through
Thread.currentThread().setContextClassloader(), it is
not able to properly deserialize object messages in
ObjectMessageImpl because it uses the default
implementation of ObjectInputStream.
Javadocs state that if you want to expand the
classloader capability, you need to extend the
resolveClass method yourself.
You would need to do something like the following:
protected Class resolveClass(ObjectStreamClass desc)
throws IOException, ClassNotFoundException {
ClassLoader cl =
Thread.currentThread().getContextClassLoader();
if (cl!=null)
return cl.loadClass(desc.getName());
return super.resolveClass(desc);
}
----------------------------------------------------------------------
Comment By: Tim Anderson (tanderson)
Date: 2006-06-11 09:22Message:
Logged In: YES
user_id=557161
Support added in CVS. Will be available in 0.7.7-beta-1
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=474139&aid=982260&group_id=54559