You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Srinivas Kurella <Sr...@cosinecom.com> on 2001/02/08 01:42:26 UTC

context related classpath question -ASAP

Tomcat documentation says that all the jars under the WEB-INF/lib directory
in a context are automatically added to the CLASSPATH.
I am finding this not to be true. I have to add them explicitly to the
CLASSPATH.
Am i missing something ???

Re: Question about preference within classpath...

Posted by Peiqiang Han Bis <pe...@nextenso.com>.
Charles,

The jar which is in $TOMCAT_HOME\lib takes precedence, because it is in
the system CLASSPATH. For TOMCAT 3.2,
the order in which classes are loaded is that bootstrap  - ext - system
classpath (CLASSPATH environment variable) - custom classloader
(WEB-INF\classes or
WEB-INF\lib).

hope this helps,
-Peiqiang Han

Charles Sabourdin wrote:

> Question about preference within classpath...
> My question is purely théorical, If I have a jar in my
> $TOMCAT_HOME\lib and one into
> $TOMCAT_HOME\webapps\mywebapp\WEB-INF\lib
> and one is a newer version then the other, which of
> those two will be used ?
> I have the same question with classes?
>
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail - only $35
> a year!  http://personal.mail.yahoo.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-user-help@jakarta.apache.org


Question about preference within classpath...

Posted by Charles Sabourdin <zo...@yahoo.com>.
Question about preference within classpath...
My question is purely th�orical, If I have a jar in my
$TOMCAT_HOME\lib and one into
$TOMCAT_HOME\webapps\mywebapp\WEB-INF\lib
and one is a newer version then the other, which of
those two will be used ?
I have the same question with classes?

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

Re: context related classpath question -ASAP

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Srinivas Kurella wrote:

>
>
> Tomcat documentation says that all the jars under the WEB-INF/lib
> directory in a context are automatically added to the CLASSPATH.
>

This is not precisely what happens.


>
> I am finding this not to be true. I have to add them explicitly to the
> CLASSPATH.
> Am i missing something ???

What happens is that classes in JAR files under WEB-INF/lib, and
unpacked classes under WEB-INF/classes, are automatically made visible
to other classes in the same web application.  They are *not* added to
the CLASSPATH environment variable, which makes sense when you remember
that CLASSPATH is global to the entire JVM, but the set of classes
visible to each webapp are unique to that webapp.

Craig McClanahan