commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henri Yandell <bay...@generationjava.com>
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
tomcat].

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

> > 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.

Hen


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message