Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

rmi security problem : policy file

 
Michael Tu
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have to bring myself here as the problem makes me crazy

I created a security manager in my RMI server simply use:
System.setSecurityManager(new RMISecurityManager());

Also, I have a fbn.policy file like:
grant {
permission java.security.AllPermission;
};

then I start my RMI server by specifying -Djava.security.policy=c:\...\fbn.policy. The server runs OK.
Now, my client side also has a line of:
System.setSecurityManager(new RMISecurityManager());

I run my client in the same PC with -Djava.security.policy=c:\...\fbn.policy. It doesn't work! Connection error comes out.
If I do not implement SecurityManager, everything is fine. What's the hell for this? Can anyone advise? Thanks.
Michael
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I run my client in the same PC with -Djava.security.policy=c:\...\fbn.policy. It doesn't work! Connection error comes out.
If I do not implement SecurityManager, everything is fine. What's the hell for this? Can anyone advise? Thanks.

The consensus in this group is that you should not use policy files, security managers, codebase or classpath settings, or dynamic downloading. These are the "extra features" that do not add much to your design, but they complicate things greatly for you and your accessor.
Eugene.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic