JDK-8153736 : NPE in JarIndexWrapper if jar has no jar index.
  • Type: Bug
  • Component: deploy
  • Sub-Component: webstart
  • Affected Version: 9
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2016-04-07
  • Updated: 2017-07-21
  • Resolved: 2016-04-07
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 9
9 b116Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Description
This has been seen in all javaws applications - and likely applies to plugin as well.  In JDK9 b113 client code you can get the following exception running a simple javaws app such as:
http://oklahoma.us.oracle.com/www/tests/sandbox/hellos.jnlp

java.lang.NullPointerException^M
        at sun.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-internal/Native Method)^M
        at sun.reflect.NativeMethodAccessorImpl.invoke(java.base@9-internal/NativeMethodAccessorImpl.java:62)^M
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-internal/DelegatingMethodAccessorImpl.java:43)^M
        at java.lang.reflect.Method.invoke(java.base@9-internal/Method.java:531)^M
        at com.sun.deploy.security.JarIndexWrapper.getJarFiles(jdk.deploy@9-internal/JarIndexWrapper.java:90)^M
        at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.run(jdk.deploy@9-internal/DeployURLClassPath.java:763)^M
        at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.run(jdk.deploy@9-internal/DeployURLClassPath.java:755)^M
        at java.security.AccessController.doPrivileged(java.base@9-internal/Native Method)^M
        at com.sun.deploy.security.DeployURLClassPath$JarLoader.ensureOpen(jdk.deploy@9-internal/DeployURLClassPath.java:754)^M
        at com.sun.deploy.security.DeployURLClassPath$JarLoader.<init>(jdk.deploy@9-internal/DeployURLClassPath.java:743)^M
        at com.sun.deploy.security.DeployURLClassPath$3.run(jdk.deploy@9-internal/DeployURLClassPath.java:429)^M
        at com.sun.deploy.security.DeployURLClassPath$3.run(jdk.deploy@9-internal/DeployURLClassPath.java:419)^M
        at java.security.AccessController.doPrivileged(java.base@9-internal/Native Method)^M
        at com.sun.deploy.security.DeployURLClassPath.getLoader(jdk.deploy@9-internal/DeployURLClassPath.java:419)^M
        at com.sun.deploy.security.DeployURLClassPath.getLoader(jdk.deploy@9-internal/DeployURLClassPath.java:393)^M
        at com.sun.deploy.security.DeployURLClassPath.getResource(jdk.deploy@9-internal/DeployURLClassPath.java:251)^M
        at com.sun.deploy.security.DeployURLClassLoader$1.run(jdk.deploy@9-internal/DeployURLClassLoader.java:285)^M
        at com.sun.deploy.security.DeployURLClassLoader$1.run(jdk.deploy@9-internal/DeployURLClassLoader.java:282)^M
        at java.security.AccessController.doPrivileged(java.base@9-internal/Native Method)^M
        at com.sun.deploy.security.DeployURLClassLoader.findClass(jdk.deploy@9-internal/DeployURLClassLoader.java:281)^M
        at com.sun.jnlp.JNLPClassLoader.findClass(jdk.javaws@9-internal/JNLPClassLoader.java:372)^M
        at java.lang.ClassLoader.loadClass(java.base@9-internal/ClassLoader.java:486)^M
        at java.lang.ClassLoader.loadClass(java.base@9-internal/ClassLoader.java:473)^M
        at java.lang.ClassLoader.loadClass(java.base@9-internal/ClassLoader.java:419)^M
        at com.sun.javaws.Launcher.doLaunchApp(jdk.javaws@9-internal/Launcher.java:1482)^M
        at com.sun.javaws.Launcher.run(jdk.javaws@9-internal/Launcher.java:164)^M
        at java.lang.Thread.run(java.base@9-internal/Thread.java:804)^M


Comments
Verified with jre9-b179 on win7/x86
21-07-2017

Andy, any idea on which promoted build this fix goes?
28-04-2016

Null Pointer Exception when launching Web Start applications https://bugs.openjdk.java.net/browse/JDK-8153736 (Duplicate bug JDK-8154155) This bug was found in b113 and is expected to be fixed in 9 ea-115 (build 115) all being well.
14-04-2016

Crucible review at: https://java.se.oracle.com/code/cru/CR-JDK9CLIENT-1878
07-04-2016

fix is in getJarIndex (line 66). replace: return new JarIndexWrapper(jarIndex); with: return jarIndex == null ? null : new JarIndexWrapper(jarIndex);
07-04-2016