United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6462889 Unexpected behavior related to caching of jar files bearing same name but different versions
JDK-6462889 : Unexpected behavior related to caching of jar files bearing same name but different versions

Details
Type:
Bug
Submit Date:
2006-08-23
Status:
Closed
Updated Date:
2011-03-08
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
deploy
OS:
generic,windows_xp
Sub-Component:
deployment_toolkit
CPU:
x86,generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports
Backport:

Sub Tasks

Description
Caching of jars and corresponding entry inside the cache viewer is not working as expected. Steps described below will explain the problem in detail

1) Load following applet
http://sqeweb.sfbay.sun.com/deployment2/jitu/plug-bug/cachingtest/new/html/TestMJ_local.html

This applet conatins following archive tag
<PARAM NAME = archive VALUE ="firstjar.jar,secondjar.jar" >


- Java console output :
-----------------------

pathname: C:\Documents and Settings\jitu\Application Data\Sun\Java\Deployment\cache\6.0\3\33a73e83-357c729e
pathname: C:\Documents and Settings\jitu\Application Data\Sun\Java\Deployment\cache\6.0\3\33a73e83-357c729e.idx
pathname: C:\Documents and Settings\jitu\Application Data\Sun\Java\Deployment\cache\6.0\58\d561afa-79b81e5f
pathname: C:\Documents and Settings\jitu\Application Data\Sun\Java\Deployment\cache\6.0\58\d561afa-79b81e5f.idx
To Output: no of files cached inside the cache directory: 2
=================================
Test applet loaded successfully without errors

- Invoke cache viewer as  JCP > View
and you can notice following getting displayed inisde the cache viewer under Resources:
"firstjar.jar"    with size 2.0 kb
"secondjar.jar"    with size 3.8 kb

Close browser session and close the JCP /cache viewer

2) Invoke the second applet  in a different browser session

http://sqeweb.sfbay.sun.com/deployment2/jitu/plug-bug/cachingtest/new/html/TestMJ_Carchversion.html
It uses the following archive tags.
<PARAM NAME = archive VALUE ="firstjar.jar" >
<PARAM NAME = cache_archive VALUE ="secondjar.jar" >
<PARAM NAME = cache_version VALUE ="0.0.0.1" >

Now since secondjar.jar is specifed with different version so it should get cached again

- Java console output :
-----------------------
Applet inited ....
Applet Started .....
To Output:  PluginCacheVerifier :C:\Documents and Settings\jitu\Application Data\Sun\Java\Deployment\cache\6.0
To Output:  PluginCacheVerifier,archive tag :firstjar.jar
To Output:  PluginCacheVerifier,cache_archive tag :secondjar.jar
To Output: Total jar files :firstjar.jar,secondjar.jar
To Output: inside getCacheFileNames:
To Output: total bucket directories under cache directory: 64
pathname: C:\Documents and Settings\jitu\Application Data\Sun\Java\Deployment\cache\6.0\3\33a73e83-357c729e
pathname: C:\Documents and Settings\jitu\Application Data\Sun\Java\Deployment\cache\6.0\3\33a73e83-357c729e.idx
pathname: C:\Documents and Settings\jitu\Application Data\Sun\Java\Deployment\cache\6.0\58\d561afa-209711fa-0.0.0.1-
pathname: C:\Documents and Settings\jitu\Application Data\Sun\Java\Deployment\cache\6.0\58\d561afa-209711fa-0.0.0.1-.idx
pathname: C:\Documents and Settings\jitu\Application Data\Sun\Java\Deployment\cache\6.0\58\d561afa-79b81e5f
pathname: C:\Documents and Settings\jitu\Application Data\Sun\Java\Deployment\cache\6.0\58\d561afa-79b81e5f.idx
To Output: no of files cached inside the cache directory: 3
=================================
Test applet loaded successfully without errors

- Invoke cache viewer as  JCP > View
and you can notice following getting displayed inside the cache viewer under Resources:

JCP > CacheViewer
"firstjar.jar" with size 2.0 kb
"secondjar.jar"  with size 3.8 kb
"secondjar.jar"    with version as 0.0.0.1 and size 3.4 kb  ( why the size is less ???)

- Close cache viewer
- Close browser session and Invoke CacheViewer again as JCP > View
and you can notice following getting displayed inside the cache viewer under Resources:
firstjar.jar with size 2.0 kb
secondjar.jar with size 3.8 kb

- Entry secondjar.jar with version 0.0.0.1  is no more getting displayed inside the cache viewer.

3) Invoke the following applet
http://sqeweb.sfbay.sun.com/deployment2/jitu/plug-bug/cachingtest/new/html/TestMJ_Cversion.html

It uses the following archine tag.
<PARAM NAME = cache_archive VALUE ="firstjar.jar,secondjar.jar" >
<PARAM NAME = cache_version VALUE ="F.0.0.1,S.0.0.1" >

Since both firstjar.jar and secondjar.jar uses different versions so both of them should get cached again
Java console output :

Applet inited ....
Applet Started .....
To Output:  PluginCacheVerifier :C:\Documents and Settings\jitu\Application Data\Sun\Java\Deployment\cache\6.0
To Output:  PluginCacheVerifier,cache_archive tag :firstjar.jar,secondjar.jar
To Output: Total jar files :firstjar.jar,secondjar.jar
To Output: inside getCacheFileNames:
To Output: total bucket directories under cache directory: 64
pathname: C:\Documents and Settings\jitu\Application Data\Sun\Java\Deployment\cache\6.0\3\33a73e83-5ad5ca0c
pathname: C:\Documents and Settings\jitu\Application Data\Sun\Java\Deployment\cache\6.0\3\33a73e83-5ad5ca0c.idx
pathname: C:\Documents and Settings\jitu\Application Data\Sun\Java\Deployment\cache\6.0\3\33a73e83-6763db97-F.0.0.1-
pathname: C:\Documents and Settings\jitu\Application Data\Sun\Java\Deployment\cache\6.0\3\33a73e83-6763db97-F.0.0.1-.idx
pathname: C:\Documents and Settings\jitu\Application Data\Sun\Java\Deployment\cache\6.0\58\d561afa-4239f761-0.0.0.1-
pathname: C:\Documents and Settings\jitu\Application Data\Sun\Java\Deployment\cache\6.0\58\d561afa-6db40235
pathname: C:\Documents and Settings\jitu\Application Data\Sun\Java\Deployment\cache\6.0\58\d561afa-6db40235.idx
pathname: C:\Documents and Settings\jitu\Application Data\Sun\Java\Deployment\cache\6.0\58\d561afa-756d7e17-S.0.0.1-
pathname: C:\Documents and Settings\jitu\Application Data\Sun\Java\Deployment\cache\6.0\58\d561afa-756d7e17-S.0.0.1-.idx
To Output: no of files cached inside the cache directory: 4
=================================
Test applet loaded successfully without errors

Total files getting cached should be 5 but it's showing 4. You can notice from the console output above that there is on index entry against  file d561afa-4239f761-0.0.0.1-

- Invoke cache viewer as  JCP > View
and you can notice following getting displayed inside the cache viewer under Resources:

JCP > CacheViewer
firstjar.jar with size 0.0 kb  (?????)
secondjar.jar with size 0.0 kb(?????)
secondjar.jar with version S.0.0.1  and size 3.8 kb
firstjar.jar  with version  F.0.0.1  size 2.0 kb
- Close the Cache Viewer
- Close browser session and Invoke CacheViewer again as JCP >  View
and you can notice following getting displayed inside the cache viewer under Resources:

secondjar.jar with version S.0.0.1 and  size 3.8 kb
firstjar.jar with version F.0.0.1 and size 2.0 kb

This time secondjar.jar and firstjar.jar enteries without any versions fails to show up inside the cacheviewer

                                    

Comments
EVALUATION

not a 6.0 showstooper, fix for 6u1 and 7.0
                                     
2006-08-23
EVALUATION

seems like the new cache is removing old versioned resource; but instead we should just leave them as in.

the cache should only remove non-versioned resource that is updated by a newer resource.

versioned-resource should be keep intact.
                                     
2006-08-23
EVALUATION

similar complaint for CAP memeber, should take of it as part of this bug as well:

it seems to me that Java 6 cache viewer includes the size of ".idx" files, whereas Java 5 does not.  Why are these files included in the application size?   Aren't they just artifacts of Java 6 cache?
                                     
2006-08-24
EVALUATION

We include the size of the idx file since it is part of the total size of the application in the cache.
                                     
2006-11-03



Hardware and Software, Engineered to Work Together