LotusWorst
LotusWorst

Reputation: 31

Lotus Notes: Not allowed to access System Properties file

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)

Upvotes: 0

Views: 1257

Answers (2)

Samuel Omopariola
Samuel Omopariola

Reputation: 153

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.

Upvotes: 0

Per Henrik Lausten
Per Henrik Lausten

Reputation: 21709

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

enter image description here

Upvotes: 2

Related Questions