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:[EMAIL PROTECTED]]
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:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to