commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henri Yandell <>
Subject Re: [lang] reflect - Class.forName
Date Sun, 24 Nov 2002 10:17:40 GMT

On Sun, 24 Nov 2002, Max Rydahl Andersen wrote:

> If the container is written "correctly" just having more or less isolated
> the webapp's classloading from
> the containers own classloading then this would never be an problem (but
> that is not the case
> for many containers out there - and the "trick" of adding some jars to the
> "global" classpath of an container
> is widely used as I understand it )

Out of interest, do you mean adding this to the actual shellscript's
classpath, or just placing things in the common/lib directory? [in say

If it's the former, then they [and I, yeah I've done it] deserve what they

> > Because first it would throw the class cast, and then forName would fail?
> The utility should not throw class cast exceptions only classnotfound.
> The class cast situation presented by Jousaz is something I'll have to think
> about some more -
> i'll talk with my local classloading expert tomorrow, and get back to you :)
> p.s. another note on James code suggestion is that it does not check if the
> current classloader is null - it can be, thus
> James code can in some cases throw a NPE!

Cool. Anyone feel like changing/submitting a patch? :) I'll add it to the
STATUS.html for the moment.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message