United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6794977 CrossDomainXML problem with multiple threads loading resources at the same time
6794977 : CrossDomainXML problem with multiple threads loading resources at the same time

Details
Type:
Bug
Submit Date:
2009-01-16
Status:
Closed
Updated Date:
2013-01-10
Project Name:
JDK
Resolved Date:
2009-12-02
Component:
deploy
OS:
windows_xp,windows
Sub-Component:
deployment_toolkit
CPU:
x86
Priority:
P2
Resolution:
Fixed
Affected Versions:
6u10,6u14
Fixed Versions:
6u18

Related Reports
Backport:
Duplicate:

Sub Tasks

Description
install 6u10 or above

clear java cache

visit page:

http://weblogs.java.net/blog/joshy/archive/2008/05/java_doodle_cro.html

Applet will load, but only one image will be loaded.  In console, you will see serveral exception like this:

Exception in thread "Thread-15" java.security.AccessControlException: access denied (java.net.SocketPermission farm4.static.flickr.com:80 connect,resolve)
	at java.security.AccessControlContext.checkPermission(Unknown Source)
	at java.security.AccessController.checkPermission(Unknown Source)
	at java.lang.SecurityManager.checkPermission(Unknown Source)
	at java.lang.SecurityManager.checkConnect(Unknown Source)
	at sun.plugin2.applet.Applet2SecurityManager.checkConnect(Unknown Source)
	at sun.net.www.http.HttpClient.openServer(Unknown Source)
	at sun.net.www.http.HttpClient.<init>(Unknown Source)
	at sun.net.www.http.HttpClient.New(Unknown Source)
	at sun.net.www.http.HttpClient.New(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
	at java.net.URL.openStream(Unknown Source)
	at javax.imageio.ImageIO.read(Unknown Source)
	at photostrip.PhotoResource$2.run(PhotoResource.java:82)
	at java.lang.Thread.run(Unknown Source)

Hit browser refresh, or any subsequent load of the same page will work, all images will be loaded.

Looks like we have problems for initial load of resources with crossdomainxml with multiple threads.

                                    

Comments
PUBLIC COMMENTS

This fix addresses the synchronization problems in CrossDomainXML.java described in the description.
Additional problems referenced in the SDN comments are re filed as CR #6892480
                                     
2009-10-16
EVALUATION

problem is in CrossDomainXML.java in the call to check(Class[] context, URL url, final String host, int port, int mode)

When called once for a given host HOST, in the first Synchronized block, the ArrayList processedHosts gets the HOST name added to it.
Then before the host is really processed in the second synchronized block (which is called in a loop), all subsequent calls for the same host will return false.
                                     
2009-10-14
EVALUATION

This problem exists since day 1 we introduce CrossDomainXML.  I don't know root cause or fix yet.
                                     
2009-05-14
EVALUATION

fix in 6u14
                                     
2009-01-16



Hardware and Software, Engineered to Work Together