Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6190121

Jar is not usable for testing integrity of Jar files.

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 1.4.2_05, 6
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
    • Subcomponent:
      jar
    • Understanding:
      Cause Known
    • CPU:
      generic
    • OS:
      generic, solaris_8

      Description

      We have a known corrupt jar file called saxorig.jar, but:

      jar tvf saxorig.jar

      ...works fine.

      A test program which opens the problem file as either JarFile or a ZipFile will fail:

      (5.9)$ java ListJar saxorig.jar
      Error accessing: saxorig.jar: java.util.zip.ZipException: error in opening zip file
      java.util.zip.ZipException: error in opening zip file
              at java.util.zip.ZipFile.open(Native Method)
              at java.util.zip.ZipFile.<init>(ZipFile.java:112)
              at java.util.jar.JarFile.<init>(JarFile.java:127)
              at java.util.jar.JarFile.<init>(JarFile.java:65)
              at ListJar.main(ListJar.java:11)
              
      "jar tvf" would seem like a reasonable test for corrupt Jar/Zip files, but (some) corrupt files can pass that test, yet still be unusable. "jar xvf" can even extract all the files in the case of this specific instance of a captured corrupt jar file, while the classloader and the attached test program fail to open it.
      (Yes, extracting and repackaging the jar fixes the problem.)
      ###@###.### 11/3/04 15:44 GMT

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                kevinw Kevin Walls
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Imported:
                  Indexed: