0

I am doing the following inside a sandboxed Applet with Java 8u20:

Set<Integer> set = new ConcurrentSkipListSet<Integer>();
set.add((int) 1);

And i get the following exception:

network: Cacheeintrag nicht gefunden [URL: http://[0:0:0:0:0:0:0:1]:80/crossdomain.xml, Version: null]
network: Verbindung von http://[0:0:0:0:0:0:0:1]:80/crossdomain.xml mit Proxy=DIRECT wird hergestellt
network: Verbindung von http://[0:0:0:0:0:0:0:1]:80/ mit Proxy=DIRECT wird hergestellt

java.lang.SecurityException: denied access outside a permitted URL subpath
 at sun.net.www.protocol.http.HttpURLConnection.checkURLFile(Unknown Source)
 at sun.net.www.protocol.http.HttpURLConnection.writeRequests(Unknown Source)
 at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
 at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
 at com.sun.deploy.net.CrossDomainXML.check(Unknown Source)
 at com.sun.deploy.net.CrossDomainXML.check(Unknown Source)
 at sun.plugin2.applet.SecurityManagerHelper.checkConnectHelper(Unknown Source)
 at sun.plugin2.applet.AWTAppletSecurityManager.checkConnect(Unknown Source)
 at java.net.NetworkInterface$1checkedAddresses.<init>(Unknown Source)
 at java.net.NetworkInterface.getInetAddresses(Unknown Source)
 at java.net.NetworkInterface.getHardwareAddress(Unknown Source)
 at java.util.concurrent.ThreadLocalRandom.initialSeed(Unknown Source)
 at java.util.concurrent.ThreadLocalRandom.<clinit>(Unknown Source)
 at java.util.concurrent.ConcurrentSkipListMap.doPut(Unknown Source)
 at java.util.concurrent.ConcurrentSkipListMap.putIfAbsent(Unknown Source)
 at java.util.concurrent.ConcurrentSkipListSet.add(Unknown Source)
 at myCode...

Caused by: java.security.AccessControlException: access denied ("java.net.SocketPermission" "[0:0:0:0:0:0:0:1]: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.SecurityManagerHelper.checkConnectHelper(Unknown Source)
 at sun.plugin2.applet.AWTAppletSecurityManager.checkConnect(Unknown Source)
 ... 20 more

Questions:

  • What is this weird address "[0:0:0:0:0:0:0:1]:80"?
  • Is there a workaround?
  • How can i report this bug to Java or is there already a bug-report about this?
  • What would be a good alternative to a ConcurrentSkipListSet which has similar concurrency behavior?
    • Maybe: Collections.newSetFromMap(new ConcurrentHashMap<Integer, Boolean>()) ?
Frederic Leitenberger
  • 1,949
  • 24
  • 32
  • As work-around you can initialize your own Random instance via reflection into ThreadLocalRandom#localRandom – ursa Oct 09 '14 at 12:03
  • I am running in a sandbox. Most reflection functions are not possible. Additionally i can not get to `ThreadLocalRandom#localRandom` because the error occurs when initializing the class ThreadLocalRandom. – Frederic Leitenberger Oct 09 '14 at 12:08
  • 1
    java bug tracking http://bugs.java.com . and nothing related to your issue – ursa Oct 09 '14 at 12:15
  • I found the following bug listed: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8060435 Maybe it has some relationship to your problem? I am having the .add method fail in Java 8 (but not Java 7) and am kind of beside myself as to what to do. The software I'm developing was very reliant on this code. One doesn't expect parts of Java to break for no reason. – Phil Freihofner Nov 29 '14 at 02:40

0 Answers0