Richard S. Hall wrote:

Sylvain Wallez wrote:

There's a lot of existing code that uses Thread.getContextClassLoader().loadClass() to dynamically load classes instead of using Class.forName().

Okay, I understand. You are talking about bundlizing code that uses the context class loader. Yes, in that case, if that code is contained inside the bundle, then that might work.

I've mentioned this before (so disregard if necessary) but with Jetty I've had success by starting a new thread from within the bundle that wraps Jetty and simply set the context classloader to the bundle classloader for that thread. That way you don't have to mess with changing it for each call (which can become very tricky if you ask me).

Greetings, Marcel

Reply via email to