[ 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 biorn_steedom
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: Closed
Resolution: Fixed
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: Simone Bordet (biorn_steedom)
Date: 2004-03-13 14:47
Message:
Logged In: YES
user_id=128193
I am closing this bug as fixed.
Manuel, if you have problems with this, re-open it.
----------------------------------------------------------------------
Comment By: Simone Bordet (biorn_steedom)
Date: 2004-03-01 19:45
Message:
Logged In: YES
user_id=128193
Hi, I have committed a fix for this problem.
Can you please try it and tell me if it works ?
You can download the latest CVS code from
http://mx4j.sf.net/mx4j.tar.gz and issue the command 'build
tests' from the /build directory (tomorrow, let the nightly
build to run and refresh the tar.gz).
It will generate the jars and you can retry.
I'm leaving the bug open until you comment.
Thanks !
----------------------------------------------------------------------
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
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click