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