• Post Reply Bookmark Topic Watch Topic
  • New Topic

RMI Project  RSS feed

 
Gordon Swan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am creating an RMI project in netbeans but when I setup the Security Manager, access is denied but the code runs perfect without it. Could someone give me a simple example to show how to run the code with the Security Manager? I need it for an assigment.

G Swan
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
does this reference help at all?
http://www.devx.com/getHelpOn/10MinuteSolution/20444

if not, you'll have to be more specific about what you've tried, what errors you're encountering, etc.
 
Gordon Swan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Mike

This is the code I used to set up the Security Manager:

System.setProperty("java.security.policy", "RMISecurity.policy");
if(System.getSecurityManager()== null)
{
System.setSecurityManager(new RMISecurityManager());
}

I am using the the following policy file which is in my package folder:

grant {
permission java.security.AllPermission;
};

Where should I insert the following line:

java -Djava.security.policy=policyfilename


G Swan


 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gordon Swan wrote:
Where should I insert the following line:

java -Djava.security.policy=policyfilename

G Swan


That's part of the java command line that launches the program.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!