JDK-6390779 : Help set not loading from jar:An exclamation mark in zip entry related regre
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 6
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2006-02-26
  • Updated: 2010-04-03
  • Resolved: 2006-05-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b86Fixed
Related Reports
Relates :  
Relates :  
Description
A DESCRIPTION OF THE REGRESSION :
Java Web Start 1.6.0-beta
Using JRE version 1.6.0-beta Java HotSpot(TM) Client VM

This code works in production:

String PATH_HELPROOT="com/agris/apps/binmgmt/gui/help/!SSL!/JavaHelp/System_Help.hs";
            ClassLoader cl = HelpUtil.class.getClassLoader();
            URL url = cl.getResource(PATH_HELPROOT);
            helpSet = new HelpSet(cl, url);

I think the exclamation points in the path are causing problems.  This is an artifact of some design tool (robohelp, perhaps).  A 3rd party manages our help content.

REPRODUCIBLE TESTCASE OR STEPS TO REPRODUCE:
String PATH_HELPROOT="com/agris/apps/binmgmt/gui/help/!SSL!/JavaHelp/System_Help.hs";
            ClassLoader cl = HelpUtil.class.getClassLoader();
            URL url = cl.getResource(PATH_HELPROOT);
            helpSet = new HelpSet(cl, url);



RELEASE LAST WORKED:
5.0

RELEASE TEST FAILS:
mustang-beta

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I expect to get an instance of HelpSet.


ACTUAL -
Exception is: javax.help.HelpSetException: Could not parse
Got an IOException (http://localhost:8080/app/com.agris.apps.binmgmt.gui.jar!/com/agris/apps/binmgmt/gui/help/!SSL)



OBSERVED APPLICATION IMPACT:
My application is not loading its HelpSet, so help is not available.  We will not be migrating to Java SE 6 until this is fixed.

Release Regression From : mustang
The above release value was the last known release where this 
bug was known to work. Since then there has been a regression.

Comments
EVALUATION The given testcase is adequate to reproduce the problem, which I tracked down to a fix in java/net/JarURLConnection.java, v1.33, which changed int separator = spec.indexOf("!/"); to int separator = spec.lastIndexOf("!/"); Reverting that change causes the test to pass (but possibly causes some other, equally bad problem). FWIW, with 1.33 in place, the name given to ZipFile.open is like: /u/src/java/bugs/6390779/test.jar!/!1
03-03-2006

EVALUATION Found related: 4730642. Maybe jarfile/jarentry separator is really '.jar!'?
26-02-2006

EVALUATION An url 'jar:file:/dir/jarfile.jar!/jardir/!1!/file' is parsed: BEFORE MUSTANG: file: /dir/jarfile.jar jar: jardir/!1!/file IN MUSTANG: file: /dir/jarfile.jar!/jardir/!1 jar: file This causes customer compains. Steps to reproduce : # mkdir '!1!' # echo > '!1!/file' # jar -cf test.jar '!1!' # rm -rf '!1!' # cat > Test.java > > public class Test{ > public static void main(String[] args){ > try{ > java.net.URL url = Test.class.getClassLoader().getResource("!1!/file"); > url.openStream(); > System.out.println("Test passed ok"); > }catch(Exception x){ > x.printStackTrace(); > } > } > } > # javac Test.java # java -version java version "1.5.0_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05) Java HotSpot(TM) Client VM (build 1.5.0_04-b05, mixed mode) # java -classpath .:test.jar Test Test passed ok # <switch to mustang> # java -version java version "1.6.0-rc" Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-rc-b71) Java HotSpot(TM) Client VM (build 1.6.0-rc-b71, mixed mode) # java -classpath .:test.jar Test 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:113) at java.util.jar.JarFile.<init>(JarFile.java:132) at java.util.jar.JarFile.<init>(JarFile.java:70) at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:56) at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:41) at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:53) at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:104) at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:126) at java.net.URL.openStream(URL.java:1007) at Test.main(Test.java:6)
26-02-2006