[ mx4j-Bugs-907629 ] Class loading problem at RMIConnectorServer.start()
"SourceForge.net" <[email protected]>
| Newsgroups | gmane.comp.java.mx4j.devel |
|---|---|
| Message-ID | <[email protected]> |
Bugs item #907629, was opened at 2004-03-01 16:57
Message generated for change (Comment added) made by msantillan
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=450647&aid=907629&group_id=47745
Category: JSR 160 Implementation
Group: Release 2.0.0
Status: Open
Resolution: None
Priority: 9
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Simone Bordet (biorn_steedom)
Summary: Class loading problem at RMIConnectorServer.start()
Initial Comment:
The problem is that at
mx4j.remote.ConnectionResolver.getInstance(String proto)
the class loader used is the thread's context class
loader, even if in the enviroment map, another
classloader is passed. Thus, if you are using mx4j
inside a platform such as OSGi, an
java.net.MalformedURLException: Unsupported protocol: rmi
will be raised
----------------------------------------------------------------------
Comment By: Manuel Santillan (msantillan)
Date: 2004-03-01 18:13
Message:
Logged In: YES
user_id=987922
I am sorry I forgot to put my name and to attach the patch I
've used to fix this. Anyway, it is very short, i'll just
post the code here:
/*I overload the getInstance() method*/
mx4j.remote.ConnectionResolver.getInstance(String protocol, Map
environment) {
String prot =normalizeProtocol(protocol);
String resolverPackages =
findResolverPackageList();
if (environment==null)
return
loadResolver(resolverPackages, prot,
Thread.currentThread().getContextClassLoader());
Object
loader=environment.get(JMXConnectorFactory.PROTOCOL_PROVIDER_CLASS_LOAD=
ER);
if (loader!=null&&!(loader instanceof
ClassLoader)) throw new
IllegalArgumentException();
else if (loader==null) return
loadResolver(resolverPackages, prot,
Thread.currentThread().getContextClassLoader());
else return loadResolver(resolverPackages,
prot, (ClassLoader)loader);
}
And in the RMIConnectorServer, invoking the new method:
/*line: 133*/ ConnectionResolver resolver =
ConnectionResolver.getInstance(protocol, environment);
Bye!
Manuel Santillan
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=450647&aid=907629&group_id=47745
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click