[ openjms-Feature Requests-982260 ] support for context classloader during deserialization
"SourceForge.net" <[email protected]> Tue, 29 Jun 2004 14:09:01 -0700
| Newsgroups | gmane.comp.java.openjms.devel |
|---|---|
| Message-ID | <[email protected]> |
Feature Requests item #982260, was opened at 2004-06-29 16:09
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=474139&aid=982260&group_id=54559
Category: enhancement
Group: None
Status: Open
Priority: 5
Submitted By: Johnathan Conley (jconley)
Assigned to: Jim Alateras (jalateras)
Summary: support for context classloader during deserialization
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);
}
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=474139&aid=982260&group_id=54559
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com