> -----Original Message-----
> From: Mark R. Diggory [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 07, 2002 3:08 PM
> To: [EMAIL PROTECTED]
> Subject: Class Loading Question
> 
> 
> I'm looking in the ClassLoading documentation and I see this as the 
> loading order
> 
> /WEB-INF/classes of your web application
> /WEB-INF/lib/*.jar of your web application
> Bootstrap classes of your JVM
> System class loader classses (described above)
> $CATALINA_HOME/common/classes
> $CATALINA_HOME/common/endorsed/*.jar
> $CATALINA_HOME/common/lib/*.jar
> $CATALINA_HOME/shared/classes
> $CATALINA_HOME/shared/lib/*.jar
> 
> but when I look at the chart it looks like this:
> 
>        Bootstrap
>            |
>         System
>            |
>         Common
>        /      \
>   Catalina   Shared
>               /   \
>          Webapp1  Webapp2
> 


This diagram is the heirarchy according to classloaders and their parent.
i.e. the 'common' classloader's parent is the 'system' classloader.

> 
> seems as though the the ordering of the CLASSPATH for my 
> webapp should 
> look like this when I consider the chart:
> 
> /WEB-INF/classes of your web application
> /WEB-INF/lib/*.jar of your web application
> $CATALINA_HOME/shared/classes
> $CATALINA_HOME/shared/lib/*.jar
> $CATALINA_HOME/common/classes
> $CATALINA_HOME/common/endorsed/*.jar
> $CATALINA_HOME/common/lib/*.jar
> System class loader classses (described above)
> Bootstrap classes of your JVM
> 

As mentioned in the classloader doc, the WebAppClassloader goes against the
normal classloader delegation method by checking its own repository first,
then if the class is not found, it delegates to its parent. The
StandardClassLoader('common', 'shared', etc) delegates first, then if not
found checks its own repository.

> Then each level can have "precidence" over the last level, 
> this would be 
> benificial in situations where the first package of a 
> particualr type is 
> used as a default (ie XML parsers).
> 
> Why are the System/bootstrap/common classes listed before 
> shared? Seems 
> when one uses the "default" configuration strategy for XML 
> parsers one 
> would get stuck with jdk's default crimson instead of 
> tomcat's default 
> xerces when working with a "out-of-the-box" installation of Tomcat.
> 
> This would allow one to more easily override default settings 
> in the JVM 
> Classpath and Tomcat "out-of-the-box" wouldn't have any problems 
> associated with using an unfamiliar parser.
> 
> -Mark Diggory
> 
> 
> 
> --
> To unsubscribe, e-mail:   
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to