• Post Reply Bookmark Topic Watch Topic
  • New Topic

RMI toy example throws java.security.AccessControlException  RSS feed

 
Art Metzer
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, everyone.
I wrote a simple RMI test completely local to my own machine. I got the code from Appendix A in Ed Roman's Mastering Enterprise JavaBeans, if you happen to be familiar with that.
Anyway, I register my port with "rmiregistry" and successfully bind my remote object to this same port. But when I try to execute my client code, Java comes back with
"Error in lookup() java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1000 connect,resolve)"
Does anyone out there have any ideas what I should do to fix this?
Many thanks,
Art
 
Ashwin Desai
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
You will have to use a policy file to set proper permissions to allow socket connections. Say this file is named "policy.txt"
start your server as shown below

java -Djava.security.policy=policy.txt -Djava.rmi.server.codebase={your codebase} {package.class}
See if this works.
Ashwin.

[This message has been edited by Ashwin Desai (edited February 15, 2001).]
[This message has been edited by Ashwin Desai (edited February 15, 2001).]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!