You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Will Hartung <wi...@msoft.com> on 2002/12/06 19:30:25 UTC

Tomcat 4 class loader precedence order?

Hi all, class loader question (aren't they all?)

We're running against Weblogic, and Weblogic issues Service Packs which
inevitably are simply jar files with updated classes.

However, these jar files need to be specified BEFORE the regular weblogic
jar files in the classpath.

So, I'm curious as whether there is a determinate order that the files in
WEB-INF/lib are placed on the classpath, and also whether lib is placed
before WEB-INF/classes. (i.e. is it alphabetical or simply whatever order it
shows up in an unsorted directory listing)

I suppose the same question applies to the $CATALINA_HOME/shared directories
as well.

Thanx!

Regards,

Will Hartung
(willh@msoft.com)




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Tomcat 4 class loader precedence order?

Posted by micael <ca...@harbornet.com>.
I had missed this.  Thanks, Jacob.

At 01:14 PM 12/6/2002 -0600, you wrote:
>Hello Will,
>
>The way webapps work with classloaders is opposite that of the normal
>classloader precedence.  The WebappClassloader looks in its own
>classloader for libraries first before looking at parent classloaders.
>What normally happens is that the parent classloader is queried first
>for libraries and if they don't exist there, then they are loaded from
>those further down the hierarchy (closer to the current classloader).
>
>As far as the order goes, here is the WebappClassloader order:
>
>WEB-INF/classes
>WEB-INF/lib
>
>class files in the WEB-INF/classes dir are *always* loaded first.
>
>See more here:
>http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html
>
>Jake
>
>Friday, December 06, 2002, 12:30:25 PM, you wrote:
>
>WH> Hi all, class loader question (aren't they all?)
>
>WH> We're running against Weblogic, and Weblogic issues Service Packs which
>WH> inevitably are simply jar files with updated classes.
>
>WH> However, these jar files need to be specified BEFORE the regular weblogic
>WH> jar files in the classpath.
>
>WH> So, I'm curious as whether there is a determinate order that the files in
>WH> WEB-INF/lib are placed on the classpath, and also whether lib is placed
>WH> before WEB-INF/classes. (i.e. is it alphabetical or simply whatever 
>order it
>WH> shows up in an unsorted directory listing)
>
>WH> I suppose the same question applies to the $CATALINA_HOME/shared 
>directories
>WH> as well.
>
>WH> Thanx!
>
>WH> Regards,
>
>WH> Will Hartung
>WH> (willh@msoft.com)
>
>
>
>
>WH> --
>WH> To unsubscribe, 
>e-mail:   <ma...@jakarta.apache.org>
>WH> For additional commands, e-mail: 
><ma...@jakarta.apache.org>
>
>
>
>--
>Best regards,
>  Jacob                            mailto:hoju@visi.com
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>

Micael

-------------------------------------------------------

This electronic mail  transmission and any accompanying documents contain 
information belonging to the sender which may be confidential and legally 
privileged.  This information is intended only for the use of the 
individual or entity to whom this electronic mail transmission was sent as 
indicated above. If you are not the intended recipient, any disclosure, 
copying, distribution, or action taken in reliance on the contents of the 
information contained in this transmission is strictly prohibited.  If you 
have received this transmission in error, please delete the message.  Thank 
you  



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Tomcat 4 class loader precedence order?

Posted by Jacob Kjome <ho...@visi.com>.
Hello Will,

The way webapps work with classloaders is opposite that of the normal
classloader precedence.  The WebappClassloader looks in its own
classloader for libraries first before looking at parent classloaders.
What normally happens is that the parent classloader is queried first
for libraries and if they don't exist there, then they are loaded from
those further down the hierarchy (closer to the current classloader).

As far as the order goes, here is the WebappClassloader order:

WEB-INF/classes
WEB-INF/lib

class files in the WEB-INF/classes dir are *always* loaded first.

See more here:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html

Jake

Friday, December 06, 2002, 12:30:25 PM, you wrote:

WH> Hi all, class loader question (aren't they all?)

WH> We're running against Weblogic, and Weblogic issues Service Packs which
WH> inevitably are simply jar files with updated classes.

WH> However, these jar files need to be specified BEFORE the regular weblogic
WH> jar files in the classpath.

WH> So, I'm curious as whether there is a determinate order that the files in
WH> WEB-INF/lib are placed on the classpath, and also whether lib is placed
WH> before WEB-INF/classes. (i.e. is it alphabetical or simply whatever order it
WH> shows up in an unsorted directory listing)

WH> I suppose the same question applies to the $CATALINA_HOME/shared directories
WH> as well.

WH> Thanx!

WH> Regards,

WH> Will Hartung
WH> (willh@msoft.com)




WH> --
WH> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
WH> For additional commands, e-mail: <ma...@jakarta.apache.org>



-- 
Best regards,
 Jacob                            mailto:hoju@visi.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>