cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niclas Hedhman <nic...@f1.bali.ac>
Subject Re: [C2] ClassLoader issues
Date Tue, 29 Aug 2000 10:51:57 GMT
Sebastien Sahuc wrote:

> Hello,
>
> While debugging inside Cocoon2 with the lastest snapshot from CVS, I
> realized that there was some Class loader issues :
>
> in the Coccon.getClass() method, the instrcution
> 'this.getClass().getClassLoader().loadClaa(className)' gave me a NPE due
> to the fact that claa.getClassLoader() can return null (from JDK 1.2
> Javadoc ).

NPE is only returned for in getClassLoader for classes loaded by the Boot
strap classloader, i.e classes located in the rt.jar.  There should not be
any other cases. Please specify the details of your problem.

> So I would rather use the new (since 1.2)
> Thread.currentThread.getContextClassLoader() instead, since it's the
> container's role to set the correct ClassLoader that's been used by the
> servlet application.

This should be the case for other reasons than above.

Niclas


Mime
View raw message