aspose file tools*
The moose likes Distributed Java and the fly likes  no security manager rmi class loader disabled Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark " no security manager rmi class loader disabled" Watch " no security manager rmi class loader disabled" New topic
Author

no security manager rmi class loader disabled

zul' Zorander
Greenhorn

Joined: Aug 12, 2009
Posts: 21
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

Joined: Sep 19, 2005
Posts: 291

You need to set a security policy file such as:


In your start up commands:



Ed's latest article: A Java Parallel Calamity http://coopsoft.com/ar/Calamity2Article.html
zul' Zorander
Greenhorn

Joined: Aug 12, 2009
Posts: 21
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

Joined: Sep 19, 2005
Posts: 291

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

Joined: Aug 30, 2009
Posts: 1
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

Joined: Sep 19, 2005
Posts: 291

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

Joined: Feb 24, 2010
Posts: 5
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

Joined: Sep 19, 2005
Posts: 291

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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: no security manager rmi class loader disabled