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>())
?
- Maybe: