• Post Reply Bookmark Topic Watch Topic
  • New Topic

help to avoid SecuriyAcessControl Exception

 
Qasim Shabbir
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i write a simple rmi program which throw exception :

Exception in thread "main" java.security.AccessControlException: access
denied (
java.net.SocketPermission qasim resolve)
at java.security.AccessControlContext.checkPermission(AccessControlConte
xt.java:272)
i dont know how to avoid this exception i do following changes in java.policy but its not working
grant codeBase "file:///f:/java/*" {
permission java.security.AllPermission;
};
my code is reside in f:\java\bank\
please help me to prevent this error..
thank in advance..
Qasim Shabbir
 
Varun Rupela
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi:
Forgive me Qassim for really not replying. Actually, I am facing the very same problem...only our java.policy files look a little different. Here's the exception that I am getting:

The java.policy file looks like this:

And the first few lines of server program code look like this:

The command to start the server looks like this:

I feel like killing the exception now....
Thank you
 
Junaid Bhatra
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Varun,
Seems like for some reason the runtime can't find your java.policy file. Try modifying the default policy file jre/lib/security/java.policy and see if the exception goes away?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!