1

我有 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)
4

1 回答 1

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";
};

参考:https ://forums.oracle.com/thread/1178887它可以帮助你

也可以看看:Java RMI AccessControlException: access denied

于 2013-10-04T05:16:01.873 回答