本文介绍了Java小程序java.security.AccessControlException:拒绝访问java.net.SocketPermission的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我我的朋友给我一个脚本在我的网站上运行的Minecraft皮肤,但我不断收到这个错误,我没有任何线索如何去这个... =(

  java.security.AccessControlException:访问被拒绝(java.net.SocketPermission www.minecraft.net:80~~MD~~aux连接,解决)
   在java.security.AccessControlContext.checkPermission(来源不明)
   在java.security.AccessController.checkPermission(来源不明)
   在java.lang.SecurityManager.checkPermission(来源不明)
   在java.lang.SecurityManager.checkConnect(来源不明)
   在sun.plugin2.applet.Applet2SecurityManager.checkConnect(来源不明)
   在sun.net.www.http.HttpClient.openServer(来源不明)
   在sun.net.www.http.HttpClient<&初始化GT;(未知来源)
   在sun.net.www.http.HttpClient.New(来源不明)
   在sun.net.www.http.HttpClient.New(来源不明)
   在sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(来源不明)
   在sun.net.www.protocol.http.HttpURLConnection.plainConnect(来源不明)
   在sun.net.www.protocol.http.HttpURLConnection.connect(来源不明)
   在net.minecraft.skintest.math.Zombie $ 1.run(Zombie.java:82)


解决方案

也许最简单的事情将是资源复制到你的网站,并确保您已被版权持有人授予相应的权限。

此外,该网站可能添加的crossdomain.xml 文件以允许访问非同源的网站加载code。

有可能签署code完全进入到本地计算机。然而,这需要用户接受的风险,并编写安全code是出奇的难。

I friend of mine gave me a script to run minecraft skins on my site but i keep getting this error and i dont have any clue how to go about this... =(http://allcitybuilder.com/new/example.html

java.security.AccessControlException: access denied (java.net.SocketPermission www.minecraft.net: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.Applet2SecurityManager.checkConnect(Unknown Source)
   at sun.net.www.http.HttpClient.openServer(Unknown Source)
   at sun.net.www.http.HttpClient.<init>(Unknown Source)
   at sun.net.www.http.HttpClient.New(Unknown Source)
   at sun.net.www.http.HttpClient.New(Unknown Source)
   at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
   at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
   at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
   at net.minecraft.skintest.math.Zombie$1.run(Zombie.java:82)
解决方案

Probably the easiest thing would be to copy the resources to your site, making sure you have been granted appropriate rights by the copyright holder.

Alternatively, the site may add a crossdomain.xml file to allow access to code loaded from non-same-origin sites.

It is possibly to sign the code to gain full access to the local machine. However, this requires the user to accept the risk and writing secure code is surprisingly difficult.

这篇关于Java小程序java.security.AccessControlException:拒绝访问java.net.SocketPermission的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 02:37