JDK-8212793 : Fix for JDK-8189783 fails
  • Type: Bug
  • Component: deploy
  • Sub-Component: webstart
  • Affected Version: 8u181
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_8
  • CPU: x86_64
  • Submitted: 2018-10-22
  • Updated: 2019-03-19
  • Resolved: 2018-11-06
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
8u201 b03Fixed
Related Reports
Relates :  
Description
ADDITIONAL SYSTEM INFORMATION :
It occurs in Windows 10, Windows 7, and I believe Windows 8 as well. It has occurred in very different environments including PCs with no special admin software beyond Windows Defender.

A DESCRIPTION OF THE PROBLEM :
I have not created a special regression for this, but it was never actually fixed for us. The problem description given by the previous user precisely matches what we and our customers experienced. I should add that the program uses SingleInstanceServer and only occurs when the program is invoked via its file association *via a web page download*. (I have experienced the problem in Chrome, but I have not verified it with other browsers. I can easily check if necessary) Once the cache has been emptied, the error always occurs until the JWS program is reinstalled. Update 8_191 did not fix the problem and actually just made the bug happen more predictably.

REGRESSION : Last worked in version 8u172

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
It's hard to provide a simple bug demo given that I *believe* SingleInstanceServer is a key part of the problem (I can verify this if necessary), and I *know* both file associations and using a browser to download the file that triggers the association are necessary to trigger the bug for us. I was surprised to find that the browser was relevant, since the application is not an applet, but it's still true. I can open the same files by clicking on them in the Windows Explorer, and then the application always works and does not clear the cache and uninstall the application.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Applying a file association should not remove the application from the file cache. Instead, the next time the application is opened, it should run as normal.
ACTUAL -
The error stack is the same as that shown in the previous copy of this bug (but in English instead of Spanish for most customers).

CUSTOMER SUBMITTED WORKAROUND :
We do not have a satisfactory work-around. The closest we have come is not to use file associations at all, and instead to use a process that monitors the browser download directory to see whether any new files have been downloaded and then automatically opens the application if files of the correct type have appeared. Disabling SingleInstanceServer is not a satisfactory solution for us due to the startup delays that SingleInstanceServer was designed to avoid.

FREQUENCY : often



Comments
CPU19_01-critical-request - Justification : Request from sustaining - Risk Analysis : Low - Webrev : https://java.se.oracle.com/code/cru/CR-JDK8CPU-422 - Testing : manually tested locally : - Back ports : NA - FX Impact : NA - Fix For Release : 8u
25-10-2018

because javaws.exe is invoked from a parent process which is a known browser, we instruct javaws java code to delete the jnlp file passed in. It is usually a temp file downloaded by the browser, but in this case it is a jnlp file in the cache. we need to gaurd against this in the java code
24-10-2018

after clear cache and running step 1 above, relevant registry entry for .../shell/open/command shows: "C:\Program Files\Java\jre1.8.0_192\bin\javaws.exe" "-localfile" "-open" "%1" "C:\Users\aherrick.ORADEV\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\38\76ed1826-5f94ba89" step 2 does not change this, nor does step 3 looking at the javaws cache, there is then an index and lap file in bucket 38 - but no resource (jnlp file) going back to step 1, I can see an index file, lap file and the jnlp file in the cache in bucked 38, as well as the jar in bucket 3 - that is all that is in the cache after step 1 or 1 and 2. So I need to see what args are passed to javaws when launching associated file from browser.
24-10-2018

OK - I can now reproduce this after setting up a local tomcat server. I don't need jnlp servlet or SingleInstance service. I do need a local tomcat server because otherwise, I cannot launch webstart using an associated file from a browser (in my case Firefox). 1.) I run a simple app, requesting association with extension ".test2" 2.) I can then click on desktop shortcut to "test.test2", and it will launch simple app (showing args -open <path to file I clicked on> *I can repeate 2.) over and over 3.) Now I click on test2.test copy in tomcat I get FileNotFound exception for a file in the cache. I then go back to step 2.) and will also get the FileNotFound exception Re-running the app from step 1 does not fix the problem, I still cannot do step 2, till I clear the cache and run step 1 again.
24-10-2018

The original bug provided an example that did not use SingleInstanceService, but it did use JNLPDownloadServlet and associations. I had constructed a pair of apps that showed the problem (without using SingleInstance or JNLPDownloadServlet) and the fix applied (which was just a simple check for NULL) did address the problem in that case. The original bug also manifested when associated file was clicked on from the local file system (such as a shortcut or using Windows Explorer). Now it is reported the remaining problem only occurs when clicking on the associated file in a web browser. I will continue to try to construct an example to demonstrate the problem.
24-10-2018

As per submission the fix in JDK-8189783 for "Java Web Start application with file extension association is removed from cache when invoked for the second time from browser" hasn't fixed the issue for them. The program uses SingleInstanceServer and issue appears only when the program is invoked via its file association *via a web page download*.
23-10-2018