0

我在使用 Java 8u20的沙盒小程序中执行以下操作:

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

我得到以下异常:

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

问题:

  • 这个奇怪的地址“[0:0:0:0:0:0:0:1]:80”是什么?
  • 有解决方法吗?
  • 我如何向 Java 报告此错误,或者是否已经有关于此的错误报告?
  • 什么是具有类似并发行为的 ConcurrentSkipListSet 的良好替代方案?
    • 也许:Collections.newSetFromMap(new ConcurrentHashMap<Integer, Boolean>())
4

0 回答 0