• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

RMI Project

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic