Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why does AccessControlException happen? Please help me!

 
heo kangwuk
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To me accessControlException : Access denied(java.io.FilePermission \scjd read)
set classpath=;
start rmiregistry
set classpath=c:\scjd\Server.jar
---------- next --------------
java -Djava.rmi.server.codebase=file://c:\scjd/
-Djava.security.policy=remote.policy suncertify.server.Server c:\scjd\db.db
my policy file is
grant {
permission java.security.AllPermission;
};
Because upside policy file becomes error, is not measuring with a toe although it did establishing variously
grant {
permission java.net.SocketPermission "*:1024-65535", "connect, accept, resolve";
permission java.net.SocketPermission "*:80", "connect, accept";
permission java.io.FilePermission "<>","read, execute, write";
};

I found all forum to catch error, but there was no number of egg at all.
Is no there method to solve?
Help just
 
Charles Dupin
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Heo,
Are you running an applet? In which case the AppletViewer.policy must be:
grant {
permission java.security.AllPermission;
permission java.net.SocketPermission "*", "accept, connect, listen, resolve";
};
Good luck.
C.
 
Mag Hoehme
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Heo,
eventually I circumvented all this security stuff by simply *NOT* implementing a security manager - and it worked fine. The only thing you have to take is that the client has all the server stubs in its classpath.
Hope this helps.
 
Mag Hoehme
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Heo,
are you sure that your policy file has "<>" instead of "<<ALL FILES>>"? java.io.FilePermission checks the string for equality:

Remember, the security manager won't let you know if something is wrong with the security file itself.
Hope this helps.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic