Bug 6640

Summary: The classpath is not evalueted
Product: Tomcat 4 Reporter: Madalina Gheorghe <gheorghe>
Component: Webapps:ExamplesAssignee: Tomcat Developers Mailing List <dev>
Severity: major    
Priority: P3    
Version: 4.0.2 Final   
Target Milestone: ---   
Hardware: Other   
OS: All   

Description Madalina Gheorghe 2002-02-22 10:32:59 UTC
Tomcat 4 does not evalue the classpath and it does not add JAR files in the WEB-
INF/lib or the /lib directory to the application's classpath.
Comment 1 Remy Maucherat 2002-02-26 00:57:09 UTC
TC 4 will indeed ignore the system classpath.
The second part of the bug is working fine for me (it would seem appropriate to
post on tomcat-user to investigate).
Comment 2 Mark Darnell 2002-03-08 12:33:06 UTC
I've tried Tomcat 4.0.2 and 4.0.3 and I have the same problem.  The jar files 
in my web apps WEB-INF/lib directory do not get evaluated.  If I move the jar 
files to the tomcat/lib directory, they do get evaluated.  Changing the status 
to RESOLVED WORKSFORME doesn't work for me; this problem needs to be resolved.
Comment 3 Patrick Luby 2002-03-08 16:53:51 UTC
I don't know if this is the cause of your problem, but in the HEAD branch, I put 
a fix in for a very subtle problem: jar files with missing entries. Basically, 
the problem that I found was that Tomcat 4.0 would have trouble reading entries 
from jar files with missing directory entries. For example, if you have x.jar 
with a mypackage/MyClass.class file in it, Tomcat 4.0 expects to see the 
following entries if you do a "jar tf x.jar":


However, if you create or add entries into a jar file using
"jar uf mypackage/MyClass.class", the "mypackage/" entry does not get created and 
a "jar tf x.jar" like below will result:


In this case, where the "mypackage/" directory is missing, Tomcat will not find 
any of the subdirectories and files with "mypackage/".

To test if this is the cause of your problem, run "jar tf" on each of your jar 
files that are in WEB-INF/lib and see if there are any missing directory entries. 
If so, you can insert them using "jar uf" as a workaround.
Comment 4 Mark Darnell 2002-03-11 15:22:45 UTC

I tried your suggestion of updating the jar file with empty directory paths 
with no success.  I'm getting a NoClassDefFound error in the localhost_log when 
I start Tomcat.  The error occurs with the saxon.jar at 
javax/xml/transform/Source.class.  I've checked several times and the class 
does exist in the jar file.  I do not get this problem with Tomcat 4.0.1; it 
started with 4.0.2 and continued in 4.0.3.  Something must've been changed (or 
thought fixed) between 4.0.1 and 4.0.2.  I'm using Tomcat on Red Hat Linux 7.1 
if that might help in any way.
Comment 5 Remy Maucherat 2002-03-15 06:41:53 UTC
Sorry for not replying to this bug sooner; somehow, I missed it. This bug is
actually a known bug, which has already been fixed.

*** This bug has been marked as a duplicate of 6374 ***