[ mx4j-Bugs-800980 ] InvokerMBeanServerInterceptor uses Class.forName
"SourceForge.net" <[email protected]>
| Newsgroups | gmane.comp.java.mx4j.devel |
|---|---|
| Message-ID | <[email protected]> |
Bugs item #800980, was opened at 2003-09-05 12:08 Message generated for change (Comment added) made by biorn_steedom You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=450647&aid=800980&group_id=47745 Category: JMX implementation >Group: Release 2.0.0 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Dain Sundstrom (dsundstrom) Assigned to: Simone Bordet (biorn_steedom) Summary: InvokerMBeanServerInterceptor uses Class.forName Initial Comment: InvokerMBeanServerInterceptor uses Class.forName on line 104. It should use thread context class loader instead. ---------------------------------------------------------------------- >Comment By: Simone Bordet (biorn_steedom) Date: 2003-12-02 20:33 Message: Logged In: YES user_id=128193 Fixed along with few other places that used Class.forName. Thanks ! ---------------------------------------------------------------------- Comment By: Dain Sundstrom (dsundstrom) Date: 2003-09-05 20:20 Message: Logged In: YES user_id=251431 From what I understand Class.forName caches the classes in a map that can never be cleared, so you can't do class recycling. I suggest you change it to this: Thread.currentThread().getContextClassLoader().loadClass(className); Which is equivalent to what you have except at the end it uses loadClass instead of forName. ---------------------------------------------------------------------- Comment By: Simone Bordet (biorn_steedom) Date: 2003-09-05 15:35 Message: Logged In: YES user_id=128193 Hi Dain, the usage of Class.forName is because the classloader is null, so you cannot do loader.loadClass() (NPE). I am not sure what you're suggesting here, since at that time in the code, the context classloader has already been set to the MBean's classloader... Unless you want to remove the ContextClassLoaderInterceptor completely. Can you expand ? Thanks Simon ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=450647&aid=800980&group_id=47745 ------------------------------------------------------- This SF.net email is sponsored by OSDN's Audience Survey. Help shape OSDN's sites and tell us what you think. Take this five minute survey and you could win a $250 Gift Certificate. http://www.wrgsurveys.com/2003/osdntech03.php?site=8