Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to setup Security Manager for Java Servlet - RMI for Tomcat??

843840Nov 12 2001 — edited Nov 14 2001
Hi,

I am using TomCat to develop Java Servlet-RMI.

I know how to setup Security Manager for the Java Rmi Server and Java RMI Client.

---Policy File for Server----

grant {
// Allow everything for now
permission java.security.AllPermission;
};

grant codeBase
"file:/C:/TOMCAT_3.2.1/webapps/rmiServlet/WEB-INF/classes/" {
permission java.net.SocketPermission "127.0.0.1", "accept, connect, listen, resolve";
};

---Policy File for Client -----

grant {
// Allow everything for now
permission java.security.AllPermission;
};

grant codeBase
"file:/C:/TOMCAT_3.2.1/webapps/rmiServlet/WEB-INF/classes/" {
permission java.net.SocketPermission "127.0.0.1", "accept, connect, listen, resolve";
};

--------------------------------

But I do not know how to setup Security Manager for
Java Servlet-RMI Client.

I couldn't run Java Servlet - RMI Client because of the
security manager exception being thrown.

My question is how do I setup the security manager for
Java Servlet-RMI that acts as Client?

I know that when we run Java RMI Client we include the policy file name to the java command line like bolow

java -Djava.security.policy=Policy_File_Name.policy class_Name

As Java Servlet-RMI client is invoked by a html page or a servlet page, how do I include the policy to the Java Servlet-RMI Client?

I am new to this area. Can anyone help me?
Your help will be appreciated.

Thank you very much.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 12 2001
Added on Nov 12 2001
4 comments
949 views