我有jApplet,我想将缓冲区发送到服务器并转储到它,但为什么AccessControlException我无法理解。
java.security.AccessControlException: access denied (java.net.SocketPermission endpoint:8080 connect,resolve)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at sun.awt.AWTSecurityManager.checkPermission(AWTSecurityManager.java:959)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at sun.plugin2.applet.Applet2SecurityManager.checkConnect(Unknown Source)
答案 0 :(得分:2)
根据例外情况,您的应用程序无权访问套接字8080。
grant{
permission java.net.SocketPermission "localhost:1099", "connect, resolve";
permission java.net.SocketPermission "localhost:1024-", "connect, resolve";
permission java.net.SocketPermission "localhost:1024-", "accept, resolve";
};