cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Veithen <andreas.veit...@gmail.com>
Subject Re: getCurrentClassLoader returning null.
Date Mon, 20 Sep 2010 18:57:45 GMT
On Mon, Sep 20, 2010 at 16:43, Daniel Kulp <dkulp@apache.org> wrote:
> On Monday 20 September 2010 10:02:28 am Benson Margulies wrote:
>> I have some evidence that CXF misfires if the context class loader is
>> null, even without the (direct) use of the JAX-WS API. Is this a
>> concern? Should I bother to track it down?
>
> Outside of the SPI issues, what else is not working of the context classloader
> is null?   Those issues probably should be fixed.
>
> A normal standalone client or server started with a main method likely has the
> context loader as null.

IIRC, this assertion is incorrect. The context class loader of the
main thread is set to the application class loader. Since the context
class loader is inherited by new threads, the only way to have a null
context class loader would be to explicitly call
Thread#setCurrentClassLoader with a null value. Hence this is not
something that should happen in a normal runtime environment.

> Thus, it should be working fine.  The issues usually
> occur when someone creates their own classloader to load things and DOESN'T
> set the context classloader like they should.   I think that is the issue you
> are seeing with OO.   They create their own URLClassLoader or something to
> load the CXF jars and such, but fail to set the context classloader to that
> classloader.
>
>
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
>

Mime
View raw message