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!

Tomcat & RMI

843841Aug 4 2007 — edited Aug 5 2007
Hi,
I'm new in rmi.
I'm tring to run this: http://java.sun.com/docs/books/tutorial/rmi/running.html
I have one computer:

server side: Tomcat = port 80
----------------
c:\Tomcat\webapps\rmi\WEB-INF\classes\compute.jar
c:\Tomcat\webapps\rmi\WEB-INF\classes\ComputeEngine.class
c:\Tomcat\webapps\rmi\WEB-INF\classes\server.policy
c:\Tomcat\webapps\rmi\WEB-INF\classes\client\Pi.class

client side:
---------------
D:\MyJava\RMI\compute.jar
D:\MyJava\RMI\client.policy
D:\MyJava\RMI\engine\ComputeEngine.class
D:\MyJava\RMI\compute\compute.class
D:\MyJava\RMI\compute\task.class
D:\MyJava\RMI\client\Pi.class
D:\MyJava\RMI\client\ComputePi.class

server.policy:
grant codeBase "file:/c:/MyJava/RMI/"  {
	permission java.security.AllPermission;
};
client.policy:
grant codeBase "file:/c:/MyJava/RMI/" {
    permission java.security.AllPermission;
};
CLASSPATH in my computer:
D:\Programs\Java\jdk-1_5_0_08\bin;
C:\Tomcat\webapps\rmi\WEB-INF\classes\compute.jar;

I'm runing this:
start rmiregistry

java -cp D:\MyJava\RMI;c:\Tomcat\webapps\rmi\WEB-INF\classes\compute.jar
-Djava.rmi.server.codebase=file:/c:/Tomcat/webapps/rmi/WEB-INF/classes/compute.jar
-Djava.rmi.server.hostname=localhost
-Djava.security.policy=c:\Tomcat\webapps\rmi\WEB-INF\classes\server.policy engine.ComputeEngine

I get this error:
java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)

And in this link write:
"Before you execute rmiregistry, you must make sure that the shell or window in which you will run rmiregistry either has no CLASSPATH environment variable set or has a CLASSPATH environment variable that does not include the path to any classes that you want downloaded to clients of your remote objects. "
I have one computer for server & client..
Thank's alotttt
Yael
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 2 2007
Added on Aug 4 2007
1 comment
127 views