JDK-6552082 : ConcurrentModificationException caused by specification of invalid proxy servers
  • Type: Bug
  • Component: deploy
  • Sub-Component: deployment_toolkit
  • Affected Version: 6,6u10
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic,windows
  • CPU: generic,x86
  • Submitted: 2007-05-01
  • Updated: 2010-09-17
  • Resolved: 2008-06-19
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 6 JDK 7
6u10 b09Fixed 7Fixed
Related Reports
Duplicate :  
Description
I occasionally see the following error while running Java applications via Java Webstart.

java.util.ConcurrentModificationException
    at java.util.AbstractList$Itr.checkForComodification(Unknown Source)
    at java.util.AbstractList$Itr.next(Unknown Source)
    at com.sun.deploy.net.proxy.DeployProxySelector.select(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
    at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source)
    at com.sun.deploy.net.BasicHttpRequest.doGetRequestEX(Unknown Source)
    at com.sun.deploy.net.DownloadEngine.isUpdateAvailable(Unknown Source)
    at com.sun.javaws.LaunchDownload$1.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

It is very intermittent, so I don't know whether you will be able to reproduce it. The program continues to run anyway after the exception is thrown. If you run the following Java 3D application several times in a row, you may be able to see the error:

http://download.java.net/media/java3d/webstart/test/HelloUniverse.jnlp
The exception can also be seen in the Java Plug-In. Here is a stack trace from launching the simple Clock applet. The problem is related to invalid proxies being set; at least, in this scenario, the problem is 100% reproducible.

java.lang.RuntimeException: java.util.ConcurrentModificationException
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:942)
    at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:2090)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:382)
    at sun.applet.AppletClassLoader.getBytes(AppletClassLoader.java:284)
    at sun.applet.AppletClassLoader.access$100(AppletClassLoader.java:44)
    at sun.applet.AppletClassLoader$1.run(AppletClassLoader.java:173)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:170)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:127)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:618)
    at sun.applet.AppletPanel.createApplet(AppletPanel.java:786)
    at sun.plugin.AppletViewer.createApplet(AppletViewer.java:2232)
    at sun.applet.AppletPanel.runLoader(AppletPanel.java:715)
    at sun.applet.AppletPanel.run(AppletPanel.java:369)
    at java.lang.Thread.run(Thread.java:619)
Caused by: java.util.ConcurrentModificationException
    at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
    at java.util.AbstractList$Itr.next(AbstractList.java:343)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:726)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:654)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:977)
    at com.sun.deploy.net.HttpUtils.followRedirects(HttpUtils.java:45)
    at com.sun.deploy.net.BasicHttpRequest.doRequest(BasicHttpRequest.java:169)
    at com.sun.deploy.net.BasicHttpRequest.doGetRequestEX(BasicHttpRequest.java:63)
    at com.sun.deploy.net.DownloadEngine.isUpdateAvailable(DownloadEngine.java:709)
    at com.sun.deploy.cache.DeployCacheHandler.get(DeployCacheHandler.java:132)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:681)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:654)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:977)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:373)
    ... 14 more

Comments
SUGGESTED FIX http://sa.sfbay.sun.com/projects/deployment_data/6u10/6552082.0 testcase: http://web-east.east.sun.com/deployment/www/tests/1.6.0_10/6552082/
29-11-2007

EVALUATION It was discovered by accident that specification of an invalid proxy server provoked a ConcurrentModificationException 100% reliably in the Java Plug-In. This problem was previously reported several months ago as an intermittent problem with Java Web Start. The fix is in the DynamicProxyManager and is to not share its cached proxy list with the outside world, but instead to return a copy. Missing synchronization was also added.
29-11-2007