小编bhu*_*van的帖子

线程"main"中的异常java.security.AccessControlException:访问被拒绝(java.util.PropertyPermission*read,write)

我正在尝试运行一个用java rmi开发的桌面应用程序.当我试图在eclipse中执行此应用程序时,我收到以下错误.请任何人提前帮助我.

Exception in thread "main" java.security.AccessControlException: access denied (java.util.PropertyPermission * read,write)
    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.checkPropertiesAccess(Unknown Source)
    at java.lang.System.getProperties(Unknown Source)
    at .HeadOfficeManager.Manager.main(Manager.java:103)
Run Code Online (Sandbox Code Playgroud)

这是代码.

public static void main(String args[])
{
    Manager frame = new Manager();
    frame.setVisible(true);
    // frame.show(); old 1.4

    // Create and install a security manager
    if (System.getSecurityManager()== null)
    {
        System.setSecurityManager(new RMISecurityManager());
    }
    try
    {
        Properties prop = System.getProperties();
        String httpPath = prop.getProperty("HTTPPath");
        new ClassFileServer(80, httpPath);
    }
    catch (IOException e)
    {}

    try
    { …
Run Code Online (Sandbox Code Playgroud)

java exception

7
推荐指数
1
解决办法
2万
查看次数

标签 统计

exception ×1

java ×1