Lotus Notes: Not allowed to access System Properties file

我们两清 提交于 2019-12-12 02:08:59

问题


I added this code to load the system properties file in Java Agent but i am getting error as allowed to access system properties.

I want to load the abcd properties file which is in Windows server in C drive From there properties file is going to be picked from the code.

inp = new FileInputStream("/abcd.properties");

    if(inp== null)
        {
            System.out.println("FIND NOT FOUND!!!!!!!!!!!");
        }
        else{
            System.out.println("FIND FOUND");
        }

    p.load(inp);
    System.out.println(p.getProperty("flag"));

I tried removing the

java.lang.SecurityException: not allowed to access system properties
08/22/2016 12:47:44 AM  HTTP JVM:   at lotus.notes.AgentSecurityManager.checkPropertiesAccess(Unknown Source)
08/22/2016 12:47:44 AM  HTTP JVM:   at java.lang.System.getProperties(System.java:342)
08/22/2016 12:47:44 AM  HTTP JVM:   at JavaAgent.NotesMain(JavaAgent.java:73)
08/22/2016 12:47:44 AM  HTTP JVM:   at lotus.domino.AgentBase.runNotes(Unknown Source)
08/22/2016 12:47:44 AM  HTTP JVM:   at lotus.domino.NotesThread.run(Unknown Source)

回答1:


Try setting "Runtime security level" to 2 in order to allow access to the file system:




回答2:


For those that may have similar issues, this is as a result of the JVM's Security Manager not allowing access to the system's properties. To allow access to the system, the security policy must specify this action, so the solution will be to change the security policy of the Java Virtual Machine (JVM), which in turn will allow access to the system properties. Please visit: www-01.ibm.com/support/docview.wss?uid=swg21173567 for a detailed solution.



来源:https://stackoverflow.com/questions/39075349/lotus-notes-not-allowed-to-access-system-properties-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!