United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7183365 Deployment cache incompatible issue
JDK-7183365 : Deployment cache incompatible issue

Details
Type:
Bug
Submit Date:
2012-07-11
Status:
Closed
Updated Date:
2013-12-13
Project Name:
JDK
Resolved Date:
2012-07-25
Component:
deploy
OS:
windows_7
Sub-Component:
deployment_toolkit
CPU:
x86
Priority:
P2
Resolution:
Fixed
Affected Versions:
7u6
Fixed Versions:

Related Reports
Backport:
Backport:

Sub Tasks

Description
J2SE Version (please include all output from java -version flag):
7u6 b17


Does this problem occur on J2SE 6ux or 7ux?  Yes / No (pick one)
No


Operating System Configuration Information (be specific):
Windows_7


Bug Description:

Issue 1:

1. While the jars gets downloaded in our application, got class not found exception for LocalApplicationProperties.class

It seems you have removed both LocalApplicationProperties.class and AssociationDesc.class from your deploy.jar.

deploy\com\sun\deploy\cache\LocalApplicationProperties.class
deploy\com\sun\deploy\cache\AssociationDesc.class


As a work around we added new classes
with the same name and it seems to have solved the issue for now.


Issue 2:

But as soon as the jars gets downloaded, Got the below issue as soon as the applet tries to launch.


cache: Trying to upgrade in place D:\JavaCache\6.0\4\369cd984-158f6707-6.4.0.0-.idx
Invalidating entry url= file=D:\JavaCache\6.0\4\369cd984-158f6707-6.4.0.0-.idx
java.io.UTFDataFormatException: malformed input around byte 177
at java.io.DataInputStream.readUTF(Unknown Source)
at java.io.RandomAccessFile.readUTF(Unknown Source)
at com.sun.deploy.cache.CacheEntry.readIndexFile602(Unknown Source)
at com.sun.deploy.cache.CacheEntry.readIndexFileOld(Unknown Source)
at com.sun.deploy.cache.CacheEntry.readIndexFile(Unknown Source)


We verified the deploy.jar again and oracle seems to have made many changes to this jar out of which notable changes were made to CacheEntry file where this

exception occurs. Attaching the diff file of CacheEntry of Jre 17U5 (working) and Jre 17U6 (Not working).


There are some changes being made especially in the methods readIndexFile where a check is made for the .idx file which is downloaded into our cache.


Steps to reproduce:
1. Install jre17u6
2. Delete all the file from java cache location (can be found from control panel -> java -> settings (in general tab) -> locations.
3. Also enable tracing and console logs of java in Control Panel->Java->Advanced->Debugging and Java Console 
4. check 'Comments' field for login information
5. Browser tries to download jars and will throw exception as "No class def found for the class LocalApplicationProperties" in the console.
6. To fix the above we modified our code and changed the package of the import for the class LocalApplicationProperties as  com.sun.deploy.model (earlier <Com.sun.deploy.cache>). The modified code is present in the "com" package provided in the attachment.

Below steps is to repackage the jar file with the modified package.

7. Now go to the java cache location and search for the string "customjpipreloader7u2" (most probably it will be available in folder no 57) 
8. Copy the 0- file (eg. 329fde76-3166fa61-6.4.0.0-) which contains this string.
9. Paste into some local folder and then extract using following command - jar -xvf <name of the 0- file> 
10. After extract delete the 0- file. (eg. 329fde76-3166fa61-6.4.0.0-) from the local folder 
11. Replace the com folder with the attached com folder.
12. Make the jar file using following command - jar -cvf <name of the 0- file> * 
13. Now replace the old 0- file in java cache location with the newly created one.
14. Re-login the application using 4th step without clearing java cache. Now jars get downloaded but as soon as applet tries to launch java exception throws in the console.

                                    

Comments
EVALUATION

First item in CR description is non-issue.  The interfaces are not public API and are not bound by external consumption.

The cache upgrade issue is real, but the cache entries files was of cache version 602, which definitely were not produced with 6u32 (as I ran this version, I got cache entries version 603, which has no problems upgrading).  It probably from JRE 1.5 or 1.6.0_02 at most.

The cause of the cache upgrade 602 failure was from the caching refactoring (CR 7163312), which also includes the cache version increment and the restructuring  cache upgrade code.
                                     
2012-07-19
Verified fix using b118
                                     
2013-12-13



Hardware and Software, Engineered to Work Together