Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4897356
Votes 5
Synopsis Include file name when ZipFile.open throws a ZipException for No such file
Category java:classes_util_jarzip
Reported Against 1.4.2
Release Fixed
State 11-Closed, duplicate of 5032358, request for enhancement
Priority: 4-Low
Related Bugs 6359688
Submit Date 28-JUL-2003
Description


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) 
======================================================================
Posted Date : 2005-12-06 17:59:03.0
Work Around
N/A
Evaluation
Agreed.  Should be easy to fix.
  xxxxx@xxxxx   2003-08-18
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.
Posted Date : 2005-12-11 16:58:52.0
Comments
  
  Include a link with my name & email   

Submitted On 22-AUG-2004
oneway_111
Please fix this bug in J2SE 1.5


Submitted On 13-OCT-2005
dmartinfamecom
Note that this bug is a special case of bug 6290451


Submitted On 09-DEC-2005
dmartinfamecom
What on earth does this bug have to do with the launcher recognizing itself? (bug 5010244)

The root cause here is that the native code which implements ZipFile.open always throws a ZipException, not a FileNotFoundException when it should.  That has NOTHING to do with bug 5010244!  Did someone mistype the bug this bug is a duplicate of?


Submitted On 09-DEC-2005
dmartinfamecom
Did someone mean to say that this is a duplicate of bug 5032358 ?


Submitted On 20-SEP-2006
j_security_check
This was a easy fix. All I need to do is to include the jar file in the command. 
so when I added this 
java -jar Test.jar 
This fixed the issue. 



PLEASE NOTE: JDK6 is formerly known as Project Mustang