dcsimg
Enabling Java security policy file - help needed
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Swapna_Prasad
Posted On:   Sunday, October 31, 2004 08:08 AM

We have an application which does not have any security manager set. Now we have made an enhancement to it and that requires an RMISecurityManager to be enabled. If I set the CommandLine Option -DSecurity.Manager then my existing application throws AccessControlException at many places. So I added permission enabling all of them in my .java.policy file in my home directory but does not seem to have any effect. Next I changed the code to set the security Manager in the class that needed RMISecurityManager to be set.. and added a policy file both through the command line as well as in .java.policy file. This also does not seem to work. From what I understand once the securityManager is set it cannot be reset also. What is that I doing wrong? How do I    More>>

We have an application which does not have any security manager set. Now we have made an enhancement to it and that requires an RMISecurityManager to be enabled. If I set the CommandLine Option -DSecurity.Manager then my existing application throws AccessControlException at many places. So I added permission enabling all of them in my .java.policy file in my home directory but does not seem to have any effect. Next I changed the code to set the security Manager in the class that needed RMISecurityManager to be set.. and added a policy file both through the command line as well as in .java.policy file. This also does not seem to work.


From what I understand once the securityManager is set it cannot be reset also.


What is that I doing wrong? How do I handle this problem.

Any help is highly appreciated.

   <<Less

Re: Enabling Java security policy file - help needed

Posted By:   Shantanu_Wagh  
Posted On:   Sunday, October 31, 2004 11:20 PM

Hi

I faced a similar problem while working with Applet which read something from the client's computer (beyond JVM).
My problem was that it was throwing a java.lang.RuntimePermission exception. Although my .java.policy file was granting that excetption.
Then I ran command line
java -Djava.security.manager -Djava.security.policy=C:Docume~1AllUsers.java.policy

which made me know that the exception thrown is java.io.FilePermission

Also since my application was a web-based so I have to change the policy file to:

/* Gives the following permission to all Applets in the http://localhost:8080 */
grant codeBase "http://localhost:8080/" {
and if its a general application just "grant { " will do.

for further assistance you can mail me at shantanuw@mastek.com
About | Sitemap | Contact