JDK-8072003 : NPE (instead of proper error dialog) thrown when some jnlp files have no resources
  • Type: Bug
  • Component: deploy
  • Sub-Component: webstart
  • Affected Version: 8u25
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2015-01-30
  • Updated: 2015-09-29
  • Resolved: 2015-02-03
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 8 JDK 9
8u60 b02Fixed 9Fixed
Description
It was discovered by accident when testing AMC that a jnlp file without any resources will throw a NPE instead of a LaunchError dialog when it is run thru javaws using the AppletLifecycle path (fx app or applet).

A jnlp file (other than a component-extension) must have at least some resources (either a <jar> element or a library extension that has (recursivly) at least one <jar> element.  The correct error dialog is shown when the jnlp file is an application-desc, but when it is not, an NPE is thrown:
java.lang.NullPointerException
    at com.sun.javaws.jnl.LaunchDesc.getAppInfo(Unknown Source)
    at sun.plugin2.applet.JNLP2Manager.getAppInfo(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:745) 
Comments
crucible: https://java.se.oracle.com/code/cru/CR-JDK9CLIENT-738
01-02-2015

There are two places NPE is thrown, depending on whether the jnlp file has an href or not. I now have two sets of tests, with and without href's: http://oklahoma.us.oracle.com/www/tests/1.9.0/8072003/nohref http://oklahoma.us.oracle.com/www/tests/1.9.0/8072003/href The nohref cases all NPE from Launcher.java because the canonical home is null - no href and no main jar -> no canonical home. This can be fixed by checking for this before using it in Launcher.launch(). The app-err case in the href cases works correctly, but the others all NPE in LaunchDesc.getAppModel() because getResources().getLocalJarDescs() is called without checking if getResources() is null. further NPE's were found in the nohref case in Launcher.java when getCanonicalHome is null.
30-01-2015

there are testcases for each type of jnlp file in http://oklahoma.us.oracle.com/www/tests/1.9.0/8072003/ with 8u60 these are all seeming to hang (trace shows throwing the NPE) - don't know why I saw before this worked properly for application-desc with a different example.
30-01-2015