• 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

Error RMI

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI, this is my problem: i create myJava.policy that contains:

grant { permission java.security.AllPermission "", "";};
grant { permission java.net.SocketPermission "*:1099-", "listen, accept, connect, resolve"; };
grant { permission java.util.PropertyPermission "*", "read, write"; };
grant { permission java.io.FilePermission "*", "read, write"; };

i still do:

-Djava.rmi.server.codebase=file://bin/
-Djava.security.manager
-Djava.security.policy="myPath/myJava.policy"

but it give me this error :
Exception in thread "main" java.security.AccessControlException: access denied ("java.io.FilePermission" "\\bin" "read")

why? In myJava.policy there's: grant { permission java.io.FilePermission "*", "read, write"; };, someone can help me? Thanks.
 
Paolo Scire' Scappuzzo
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Solved, but i have another question for you. When i write:

System.getProperties().setProperty("java.security.policy", mypolicy);
System.setSecurityManager(new SecurityManager());

these 2 statements must be written as above or i have to reverse their? Because setProperty checks if a security manager exists. I don't understand what happen if it not exist. In my execution non change nothing, but at the start there's already a default security manager. I wait your answer, bye.


reply
    Bookmark Topic Watch Topic
  • New Topic