United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6506118 1.6 Multiple applets on a web page use different classloaders with cache_version
JDK-6506118 : 1.6 Multiple applets on a web page use different classloaders with cache_version

Details
Type:
Bug
Submit Date:
2006-12-19
Status:
Closed
Updated Date:
2011-03-08
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
deploy
OS:
windows_2000
Sub-Component:
plugin
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports
Backport:

Sub Tasks

Description
FULL PRODUCT VERSION :
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
windows 2000 sp4
windows XP sp2

EXTRA RELEVANT SYSTEM CONFIGURATION :
Internet Explorer 6
Internet Explorer 7
Firefox 2

A DESCRIPTION OF THE PROBLEM :
With multiple applets running on the same web page you used to be able to make them use the same classloader by ensuring the cache_archive and cache_version parameters were the same (i.e. same codebase). Using the same classloader allowed the applets to share information.

In 1.5 (1.5.0_10) the applets always use the same classloader if the cache_archive and cache_version tags match in the OBJECT and EMBED sections

In 1.6 the applets use different classloaders when you use the cache_archive parameter, they share a classloader if you don't use the cache_archive parameter

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :

1) Complie the java source below and package app1.class into app1.jar and app2.class into app2.jar

2) Create a directory called test15versioned copy the JARs into it
3) Create a directory called test16versioned copy the JARs into it

4) Create the html and js files from the source provided
   test15versioned will have the following:

Main.html
app1.15.v.html
app2.15.v.html
app1.15.v.js
app2.15.v.js
app1.jar
app2.jar

5) Create the html and js files from the source provided
   test16versioned will have the following:

Main.html
app1.16.v.html
app2.16.v.html
app1.16.v.js
app2.16.v.js
app1.jar
app2.jar

6) Install JRE 1.5.0_10 and JRE 1.6.0

7) Open test15versioned/Main15.html in internet explorer
8) Open the java console
9) ensure the text app1 started and app2 started is showing
10) Press l to dump classloader list
11) Note ONE classloader

12) Open test16versioned/Main16.html in internet explorer
13) Open the java console
14) ensure the text app1 started and app2 started is showing
15) Press l to dump classloader list
16) Note TWO classloaders

17) As a final test remove the cache_archive parameter from  app1.16.v.js and
app2.16.v.js.

18) Repeat steps 12-15
19) Note ONE classloader

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
One classloader should be used when the applets have the same cache_archive, cache_version and codebase

ACTUAL -
Multiple classloaders are used if the cache_version parameter is used

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
Attached Seperatly
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Do not use cache_version

                                    

Comments
SUGGESTED FIX

webrev:
http://sa.sfbay.sun.com/projects/deployment_data/dolphin/6506118.0
                                     
2007-01-02
EVALUATION

The problem is that DownloadEngine.getCachedJarFile always return null because the jar file hasn't been downloaded yet when JarCacheUtil.verifyJarVersion is called.
A fix is to check the cached jar file version. If the cached jar file version doesn't satisfy the required jar file version, inform ClassLoaderInfo not to cache the classloader.

This fix needs to be backported to a mustang update release.
                                     
2007-01-02



Hardware and Software, Engineered to Work Together