DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=35056>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35056

           Summary: Class loader should ignore obsolete jar or print its
                    name if not found
           Product: Tomcat 5
           Version: 5.5.7
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: [EMAIL PROTECTED]


Configuration:

Apache/2.0.40 (Red Hat Linux)
mod_jk 1.2.8
Tomcat 5.5.7
Red Hat Linux 9
j2sdk-1_4_2_07

How to reproduce

- Deploy your application with multiple jar files in your application's lib
directory.
- The contents of one jar file are not required by the application (obsolete).
- The name of the obsolete jar file is such that it appears first in
  what I guess is Java's list() command.
- Delete the obsolete jar file.
- Request content of a servlet that has not been loaded before you deleted the
  obsolete file.

Expected behavior:

Tomcat should load the required class, or if it cannot load the class, then it
should print a helpful error message.

If the root cause is that a jar file cannot be opened, then the complete
filename of the jar file should be printed in the error message.


Actual behavior:

It appears (I am guessing here) that Tomcat caches the list of jar files in the
lib directory. It tries to open all files, including deleted ones.

It crashes with two errors:

1) WARNING: Failed to open JAR
java.util.zip.ZipException: No such file or directory
There are two issues here that need to be addressed:
a) Tomcat insists that a file that was available at deployment is available.
   It should ignore it if it does not exist.
b) It does not print the filename of the file it tries to open.

2) SEVERE: Allocate exception for servlet <your servlet here>
javax.servlet.ServletException: Error instantiating servlet <your servlet class
here>


Comment:

It might be better that Tomcat tests for the existence of the file and
if it does not exist then it should ignore it.
If that is not possible e.g. because Tomcat keeps an index of the file's
contents then it should print in the error message the complete filename of the
file it can't find.

Very much like in Java.io.FileNotFoundException where the filename is included
in the stack trace.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to