cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: classloader suggestion
Date Thu, 22 Feb 2001 18:05:08 GMT
Stefano Mazzocchi wrote:
> 
> here is a suggestion that Craig sent me privately.... can you guys take
> care of this? thanks.
> 
>                              - o -
> 
> However, here's an algorithm that will work on any servlet container
> that uses
> URLClassLoader (as Tomcat 4.0 does):
> 
> * Get the classloader for the webapp:
>     ClassLoader cl = this.getClass().getClassLoader()
> 
> * Cast it to URLClassLoader and call getURLs().
> 
> * Extract the paths from these URLs and add them to the classpath
>   you are constructing.
> 
> * Call getParent() to get this class loader's parent classloader.
> 
> * If the parent classloader is also a URLClassLoader, repeat the
>   previous three steps.
> 
> By the time this loop terminates, you will have all the JAR files and
> directories
> that are visible to the web app, no matter how many class loaders are
> involved and
> no matter which class loader contains which particular JAR files.

Ok--sounds cool, but how about all the ServletContainers that don't
use URLClassLoaders?  You know, like IBM.

Mime
View raw message