• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

access denied java.io.FilePermission  RSS feed

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I'm trying to get my RMI to work. I have a policy file which grants all permissions, looks like this:
grant codeBase "http://marie:1099/Developer/scjd/starting/-" {
permission java.security.AllPermission;
permission java.io.FilePermission "<<ALL FILES>>", "write, read, delete, execute";
permission java.security.SecurityPermission "getPolicy";
permission java.security.SecurityPermission "setPolicy";
permission java.io.SerializablePermission "enableSubclassImplementation";
permission java.io.SerializablePermission "enableSubstitution";
permission java.net.SocketPermission "marie:1099-", "accept, connect, listen, resolve";


};
It sits in my jdk bin, yet I still get a write exception, saying I don't have access to write. The file exists and I can read it, but I can't write to it (tested for that.)
Anybody have any ideas? I'm pretty desparate here!!!
 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mari,


grant codeBase "http://marie:1099/Developer/scjd/starting/-" {
permission java.security.AllPermission;
permission java.io.FilePermission "<<ALL FILES>>", "write, read, delete, execute";
permission java.security.SecurityPermission "getPolicy";
permission java.security.SecurityPermission "setPolicy";
permission java.io.SerializablePermission "enableSubclassImplementation";
permission java.io.SerializablePermission "enableSubstitution";
permission java.net.SocketPermission "marie:1099-", "accept, connect, listen, resolve";

};


If you want your policy file to grant full permission why don't you just do this:



It sits in my jdk bin, yet I still get a write exception, saying I don't have access to write. The file exists and I can read it, but I can't write to it (tested for that.)


How does your application know to use it? You should include it on the command line like this:

Hope this helps,
Michael Morris
 
Mari Wessels
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks! Removed the codebase line from the policy file and it worked a charm.
Mari.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!