JDK-7195873 : cached applet jar files lead to incorrect requests from web server
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 7
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_vista
  • CPU: x86
  • Submitted: 2012-09-03
  • Updated: 2014-08-21
  • Resolved: 2012-09-12
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 7 JDK 8
7u10Fixed 8 b56Fixed
Description
FULL PRODUCT VERSION :
1.7.0_06
1.7.0_07

ADDITIONAL OS VERSION INFORMATION :
Windows Vista
Windows 7
Windows 8

A DESCRIPTION OF THE PROBLEM :
If there is a cached version of a requested jar file for an applet, the java plugin makes a request to the web server for a jar.pack.gz file, which will not exist in most cases. If the web server does not respond Status-not-found but Status-multiple-choices, the plugin does not start the java applet at all.

REGRESSION.  Last worked in version 6u31

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :

Please consider the following java applet for example:

http://www.schulphysik.de/java/physlet/applets/truckrace.html

If one loads the java applet for the first time, everything works fine.
And this is the network recording:

HTTP:Request, GET /java/physlet/classes/Animator4_.jar
HTTP:Response, HTTP/1.1, Status: Ok

Now, the jar file is in the cache.

Now, close the browser and try to open it again.
Now, the applet does not start.

This is the network recording:

GET /java/physlet/classes/Animator4_.jar.pack.gz
HTTP:Response, HTTP/1.1, Status: Multiple choices

For some reason, the plugin now tries to request a jar.pack.gz file, which does not exist, instead of the jar file. Now, if the web server is configered not to respond with a Status-not-found but with a Status-multiple-choices, then the java plugin does neither load the correct jar file nor uses the cached version.
If, however, the webserver would respond with a Status-not-found then the plugin uses the cached jar file.


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
If there is a cached version of a jar file, the java plugin should make a correct request to the web server to check if it is outdated. The java plugin should not change "example.jar" to "example.jar.pack.gz". Or if this is a standard behaviour, the plugin should handle Status-multiple-choices replies correctly.
ACTUAL -
The java plugin makes a request for "example.jar.pack.gz" instead of "example.jar" and does not handle the web server response "Status-multiple-choices" correctly.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
* SecurityException: Illegal URL redirect
* ClassFormatError: Incompatible magic value 1008813135 in class...  (this is the beginning of the multiple-choice response <!DO ...)
* ClassNotFoundException: ...

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
http://www.schulphysik.de/java/physlet/applets/truckrace.html
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
If you clear the java cache, then the applet will start correctly for one time. (The next time the applet is in the cache again, ...)

Comments
EVALUATION Regression from cache refactoring changes. Fixed by restoring correct order in query for update.
05-09-2012