JDK-8168415 : ShowDocument fails with URL using jnlp or jnlps protocol
  • Type: Bug
  • Component: deploy
  • Sub-Component: webstart
  • Affected Version: 8u91,9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-10-20
  • Updated: 2019-01-14
  • Resolved: 2016-10-26
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
8u192Fixed 9 b144Fixed
Description
Both BasicService.showDocument, and AppletContext.showDocument should be able to take any of the following URLS and launch the webstart app
jnlp:http://example.com/example.jnlp
jnlp://example.com/example.jnlp
jnlp:https://example.com/example.jnlp
jnlps://example.com/example.jnlp
none of these will work for various reasons, the first of which is that any of the following URLS passes to "new URL()" will result in a MalformedURLException.

see: https://bug.oraclecorp.com/pls/bug/webbug_print.show?c_rptno=24905618
Comments
Crucible review: https://java.se.oracle.com/code/cru/CR-JDK9CLIENT-2540
25-10-2016

to test BasicService I use: http://oklahoma.us.oracle.com/www/tests/jnlp/handler/ as in BugDB you can test AppletContext.showDocument using : https://docs.oracle.com/javase/tutorial/deployment/applet/browser.html
20-10-2016

The first problem is easily fixed by adding protocol handlers for jnlp and jnlps that just defer openConnection to URL.openConnection passing the appropriate translated URL. This alone fixes the call to ShowDocument from AppletContext.showDocument by making it possible to construct URLs using the jnlp or jnlps authority. The implement in BasicService.showDocument has some further existing problems in JDK9: 1.) There is a feature that when the target is a jnlp file, the app can launch without splash screen and without showing additional empty tab in a browser. This is broken by limited doPrivilige block that is not granted sufficient permission to execute javaws. 2.) the check for is it a jnlp file is not granted sufficient privilige to do HEAD request to requested URL, and as such shows an API Dialog asking permission to connect to the server. 3.) The resource will not be in the cache with full given name ("jnlp:http://..."), and the code does not switch to use the full URL for the call to javaws.
20-10-2016