• 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

AccessControlException hocuspocus

 
Ranch Hand
Posts: 179
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I try to make a RMI connection with my client application, I get AccessControlException.
Solution for that would be configuring the security policy like that:
java -jar -Djava.security.policy=client.policy runme.jar

The client.policy file:


But the instructions clearly say that: "Your programs must not require use of command line property specifications".

So what are my options?

I have read that security policy is only required when the stubs are not provided, but I have included them - how do I test that anyway?
 
Juhan Voolaid
Ranch Hand
Posts: 179
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, found it.

The problem was, that I set new security manager in my code:
System.setSecurityManager(new RMISecurityManager());

Just had to delete it and it worked fine. I accidentally copied that code from RMI tutorial.
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if you use RMI and have the security manager (which is forbidden) you automatically failed.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everybody,
I hav the Bodgitt & Scarper assignment.
I must not require the installation of a security manager. Does this mean I must not include a policy file?
TIA
Gr Daniel
 
Juhan Voolaid
Ranch Hand
Posts: 179
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yep. Without specifying any security policy and not doing that:
System.setSecurityManager(new RMISecurityManager());

... my application works without problems.
reply
    Bookmark Topic Watch Topic
  • New Topic