JDK-4897356 : Include file name when ZipFile.open throws a ZipException for No such file
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util.jar
  • Affected Version: 1.4.2
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_9
  • CPU: sparc
  • Submitted: 2003-07-28
  • Updated: 2005-12-11
  • Resolved: 2005-12-06
Related Reports
Duplicate :  
Relates :  
Description
Name: rmT116609			Date: 07/28/2003


A DESCRIPTION OF THE REQUEST :
Include the filename of the zipfile which caused the no such file or directory
exception.

Occures in all JDK version on all platforms.

JUSTIFICATION :
Starting large java applications which can use a lot of jars (ours uses 43
currently).  When something goes wrong and one is missing, we use truss to find
out which one, as the information is available in the ZipFile class adding it to
ZipExecption message would make things easier.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
java -jar test.jar
Exception in thread "main" java.util.zip.ZipException: No such file or directory test.jar
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:105)
        at java.util.jar.JarFile.<init>(JarFile.java:110)
        at java.util.jar.JarFile.<init>(JarFile.java:52)

ACTUAL -
java -jar test.jar
Exception in thread "main" java.util.zip.ZipException: No such file or directory
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:105)
        at java.util.jar.JarFile.<init>(JarFile.java:110)
        at java.util.jar.JarFile.<init>(JarFile.java:52)


---------- BEGIN SOURCE ----------
Do not need source code execute:
java -jar test.jar
in a directory that doesn't have a test.jar in it.
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
use truss
(Incident Review ID: 192698) 
======================================================================

Comments
EVALUATION As part of the work in 5010244, the launcher was changed so that when a given jar file was not found, a better message was produced. The Zip APIs were not changed. However, as JDC poster notes, this bug is better specified as a duplicate of 5032358.
11-12-2005

EVALUATION Agreed. Should be easy to fix. ###@###.### 2003-08-18
18-08-2003