[Asterisk-java-users] Strange exception occurs when trying to access policy file
Brought to you by:
srt
From: Balaji C. <bal...@gm...> - 2008-06-02 08:54:23
|
Hi All, 1. I have a problem with my RMI code when I am trying to connect one java application on Linux environment. When I run my rmi code it gives the following error, java.security.AccessControlException: access denied (java.util.PropertyPermission java.security.policy write) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264) at java.security.AccessController.checkPermission(AccessController.java:427) at java.lang.SecurityManager.checkPermission(SecurityManager.java:532) at java.lang.System.setProperty(System.java:699) at HelloAgiScript.service(HelloAgiScript.java:48) at org.asteriskjava.fastagi.internal.AgiConnectionHandler.runScript(AgiConnectionHandler.java:144) at org.asteriskjava.fastagi.internal.AgiConnectionHandler.run(AgiConnectionHandler.java:116) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) at java.lang.Thread.run(Thread.java:595) I have setup the security manager in my code as System.setProperty("java.security.policy", "HelloAgiScript.policy"); if (System.getSecurityManager() == null) { System.setSecurityManager(new RMISecurityManager()); } And I have created the security policy file as grant { permission java.security.AllPermission; }; Can anyone assist me to solve this problem please... 2 . Also I got exception, java.security.AccessControlException: access denied (java.util.PropertyPermission user.dir read) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264) at java.security.AccessController.checkPermission(AccessController.java:427) at java.lang.SecurityManager.checkPermission(SecurityManager.java:532) at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1285) at java.lang.System.getProperty(System.java:628) at HelloAgiScript.service(HelloAgiScript.java:51) at org.asteriskjava.fastagi.internal.AgiConnectionHandler.runScript(AgiConnectionHandler.java:144) at org.asteriskjava.fastagi.internal.AgiConnectionHandler.run(AgiConnectionHandler.java:116) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) at java.lang.Thread.run(Thread.java:595) when I try to get the current path using the line "String filePath = System.getProperty("user.dir");"..Please tell whether these type of functionalities allowed in Asterisk-java environment. Thanks/Regards, Sourab |