This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

no security manager rmi class loader disabled

 
zul' Zorander
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was going through this tutorial http://java.sun.com/j2se/1.5.0/docs/guide/rmi/hello/hello-world.html" target="_new" rel="nofollow">Example . I followed the tutorial and got proper output from client.java. But when I tried to run the program i am getting following exception no security manager rmi class loader disabled. I understand that we need to add security manager in our server class so i added the following code in my server.java
if (System.getSecurityManager() == null) {
System.setSecurityManager(new RMISecurityManager());
}
After this when i try to run client class from my machine i am getting following message java.security.accessControlException. Do I need to add similar code in client class also???
Also I am not finding good tutorails for RMI. Can any one suggest good books or site that has detailed information about RMI???
Any help in this regard would be appreciated.

Thanks
Zeddicus
 
Edward Harned
Ranch Hand
Posts: 291
Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to set a security policy file such as:


In your start up commands:

 
zul' Zorander
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Edward I fixed the problem. Can you suggest any good resources for learning RMI. I am finding it difficult to find one

Thanks
Zeddicus
 
Edward Harned
Ranch Hand
Posts: 291
Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Go to Esmonds home page at: http://www.telekinesis.com.au

He wrote a book on RMI years ago. It's the best in class, but RMI hasn't changed that much since the first edition.

 
Gaurav Kalal
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Edward Harned wrote:You need to set a security policy file such as:


In your start up commands:




Hi Edward
I am totally new to RMI and facing the same exception. Can you please tell me where to set security policy (is it in server.java?)

Thanks
Gaurav
 
Edward Harned
Ranch Hand
Posts: 291
Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You create a policy file such as policy.all (with what I posted) and then in your start up script you add the line I posted that points to that file.
 
Rohan Honwade
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Edward Harned wrote:You create a policy file such as policy.all (with what I posted) and then in your start up script you add the line I posted that points to that file.

I am encountering the same problem. Can you please tell me where exactly the policy.all file should be placed?
 
Edward Harned
Ranch Hand
Posts: 291
Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am encountering the same problem. Can you please tell me where exactly the policy.all file should be placed?


In the file system [where else?].

The start up script points to that file: -Djava.security.policy=/Location of the file/policy.all
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic