Equinox solved this problem? I think equinox uses this api through out the code.
-----Original Message----- From: Richard S. Hall [mailto:[email protected]] Sent: Friday, April 16, 2010 3:17 AM To: [email protected] Subject: Re: Can the thread context classloader issue be solved at all? On 4/15/10 5:24 PM, Dan H wrote: > Libraries such as Hibernate and StAX that use Thread.getContextClassLoader() do not work (well) in Felix / Karaf. > From what I've read it's because the OSGi Alliance never got around to specifying how this method should behave in an OSGi environment. > > I was wondering if it is possible in theory to create a bundle that provides a "correct" thread context classloader for all other bundles? > I imagine it would involve writing a custom delegating classloader and a bundle listener that basically just make all exported classes from any bundle visible to the thread context classloader. However, I don't see a way to reliably set the context classloader since the main thread is managed by Felix. > There is no reliable way to do this since there are underlying JRE issues that cause memory leaks. Such an approach as you suggest is implemented by Equinox and its "context finder" class loader, but they uncovered these various issues and this is why it has never been spec'ed by OSGi, not because they never got around to it. -> richard > -Dan > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

