Re: [Asterisk-java-users] Strange exception occurs when trying toaccess policy file
Brought to you by:
srt
From: Martin S. <ma...@be...> - 2008-06-03 17:19:40
|
Hello Balaji, You're running into security policies enforced by the JVM you're running code inside. It hasn't anything to do with Asterisk-Java. Try your one statement inside a simple main method: System.getProperty("user.dir"); It should throw the same exception. Consult Google for ways of changing the current security policy. Martin Smith, Systems Developer ma...@be... Bureau of Economic and Business Research University of Florida (352) 392-0171 Ext. 221 ________________________________ From: ast...@li... [mailto:ast...@li...] On Behalf Of Balaji Chinan Sent: Monday, June 02, 2008 4:54 AM To: ast...@li... Subject: [Asterisk-java-users] Strange exception occurs when trying toaccess policy file 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(AgiConn ectionHandler.java:144) at org.asteriskjava.fastagi.internal.AgiConnectionHandler.run(AgiConnection Handler.java:116) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecuto r.java:650) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja va: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(AgiConn ectionHandler.java:144) at org.asteriskjava.fastagi.internal.AgiConnectionHandler.run(AgiConnection Handler.java:116) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecuto r.java:650) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja va: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 |