tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan Pearlman Spencer" <Alan.PearlmanSpen...@Mobileaware.com>
Subject RE: TOMCAT does not set the CLASSPATH for my WebAPP
Date Tue, 20 Nov 2001 10:06:41 GMT
Hi Again,
Tomcat, in it's batch file, has it's own CLASSPATH.
It creates a ClassLoader for each webapp.
It used all jars in lib directory and the classes directory.

The problem you are seeing is that the ClassLoaders are in
a tree structure.
TOMCAT_CLASSLOADER
  WEBAPP_X_CLASSLOADER
  WEBAPP_Y_CLASSLOADER
Take a look at the documentation for java.lang.ClassLoader for info on
this.

If a class A is loaded in WEBAPP_X_CLASSLOADER and it tries to load
another
class B (or resource) it first looks in WEBAPP_X_CLASSLOADERs classpath
and
then goes to the parent TOMCAT_CLASSLOADER. If B is not found in
WEBAPP_X_CLASSLOADER, but is found in TOMCAT_CLASSLOADER and it then in
turn
tries to load another class or resource C it can only "see"
TOMCAT_CLASSLOADER,
so it does not have access to the WEBAPP_X_CLASSLOADER classpath.

I think in your case:
Servelt loaded in WEBAPP_X_CLASSLOADER
XML file loaded in WEBAPP_X_CLASSLOADER
XML parser loaded in TOMCAT_CLASSLOADER
DTD searched for in TOMCAT_CLASSLOADER and not found.

It probably makes sense to put the log4J.jar in the TOMCAT_CLASSLOADER's
classpath...

Is this clearer?
Alan.

-----Original Message-----
From: Roland Berger [mailto:roland.berger@plenum-systems.ch]
Sent: 20 November 2001 09:46
To: Tomcat Mailinglist
Subject: TOMCAT does not set the CLASSPATH for my WebAPP


Hi all

As I understand from the Servlet specs. a Servlet Container like Tomcat
should set the CLASSPATH for each webapp which is placed in
%TOMCAT_HOME%/webapps. e.g. if I have placed a .jar file in
%TOMCAT_HOME%/webapps/mywebapp/WEB-INF/lib/myjar.jar it should add to
the
CLASSPATH the path %TOMCAT_HOME%/webapps/mywebapp/WEB-INF/lib/myjar.jar
.

But Tomcat doesn't do that with me. I have checked the tomcat.bat
startup
script. Dynamic Classpath generation is only done for .jar's in
%TOMCAT_HOME%/lib but not for each webapp.

So, how, where and at what time in startup procedure does tomcat
generate
the CLASSPATH for each webapp??????

Thank's a lot for any help
Roland


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message