JDK-8146292 : Exception after no-cache is demanded by a Web Server
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 7u80
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_7
  • CPU: x86_64
  • Submitted: 2015-08-03
  • Updated: 2015-12-30
  • Resolved: 2015-12-30
Related Reports
Duplicate :  
Relates :  
Description
FULL PRODUCT VERSION :
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)  

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.3.9600]
&
Linux zbox-004 3.13.0-61-generic #100-Ubuntu SMP Wed Jul 29 11:21:34 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux


EXTRA RELEVANT SYSTEM CONFIGURATION :
A bug which may crash for the same reason is the following
http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8004067.
It is the only one with the same exception.
Considering the submitter wanted to run an applet and that the problem probably occurs when a jar file is being handled.
Seems that nobody figured out why this was happening.

A DESCRIPTION OF THE PROBLEM :
We have a testserver which provides a jar file to be run on demand.

By default, the server has the option no-cache enabled, which for some reasons causes the application called to fail. We tested it on Mozilla, i am adding the corresponding headers:

Host: testserver
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Cookie: DSSignInURL=/; DSID=ac9c279dde3007875e4ab0d766929a3b; DSFirstAccess=1438609257; DSLastAccess=1438609270
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache

Response Header:

Accept-Ranges: none
Cache-Control: No-Store
Connection: close
Content-Disposition: filename*=UTF-8''jwtwebJ2.jar
Content-Length: 2239283
Content-Type: application/java-archive
Set-Cookie: DSLastAccess=1438609325; path=/; Secure


ADDITIONAL REGRESSION INFORMATION: 
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)  

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
If you have any webserver on which you can prohibit the client to cache the resources, and the resource is a jar file of any kind,
an following exception occurs:




EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The jar file to to run normally.
ACTUAL -
This exception is being thrown

java.io.IOException: Cannot find cached resource for URL: 
testerver
                at com.sun.deploy.cache.Cache.getCachedResourceFilePath(Unknown Source)
                at com.sun.deploy.cache.ResourceProviderImpl.getCachedResourceFilePath(Unknown Source)
                at com.sun.javaws.security.JNLPSignedResourcesHelper.getSignedJNLPBits(Unknown Source)
                at com.sun.javaws.security.JNLPSignedResourcesHelper.getSignedJNLPFile(Unknown Source)
                at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedLaunchDescHelper(Unknown Source)
                at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedLaunchDesc(Unknown Source)
                at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedLaunchDesc(Unknown Source)
                at com.sun.javaws.Launcher.prepareResources(Unknown Source)
                at com.sun.javaws.Launcher.prepareAllResources(Unknown Source)
                at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
                at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
                at com.sun.javaws.Launcher.launch(Unknown Source)
                at com.sun.javaws.Main.launchApp(Unknown Source)
                at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
                at com.sun.javaws.Main.access$000(Unknown Source)
                at com.sun.javaws.Main$1.run(Unknown Source)
                at java.lang.Thread.run(Unknown Source)


REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
If you disable in the java configuration
caching by unticking  "Keep temporary files on my computer"
then it works normally.