Hi,
I am tring to do RMI tutorial,
[http://java.sun.com/docs/books/tutorial/rmi/index.html]
server is starting, but client do not got the permision,
didn't figure out why - Windows XP with IIS httpserver on it to share Pi.class, all is runnig in VirtualBox on Linux Fedora 11,
this is what I got:
C:\Inetpub\wwwroot\server>java -cp C:\Inetpub\wwwroot\classes;C:\Inetpub\wwwroo
t\classes\compute.jar -Djava.rmi.server.codebase=file:/C:/Inetpub/wwwroot/classe
s/compute.jar -Djava.rmi.server.hostname=localhost -Djava.security.policy=serve
r.policy engine.ComputeEngine
ComputeEngine bound
but then trying to start client get this one,
C:\Inetpub\wwwroot\client>java -cp C:\Inetpub\wwwroot\classes;C:\Inetpub\wwwroot
\client\classes;C:\Inetpub\wwwroot\classes\compute.jar -Djava.rmi.server.codebas
e=file:/C:/Inetpub/wwwroot/classes/ -Djava.security.policy=client.policy client.
ComputePi localhost 45
ComputePi exception:
java.security.AccessControlException: access denied (java.net.SocketPermission 1
27.0.0.1:1099 connect,resolve)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown S
ource)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown S
ource)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
at sun.rmi.server.UnicastRef.newCall(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at client.ComputePi.main(ComputePi.java:16)
C:\Inetpub\wwwroot\client>
I am a student, this is the first week I know about RMI
at the line 16 of ComputePi.java we have:
Compute comp = (Compute) registry.lookup(name)
and the client.policy and the server.policy are looking like this
grant codeBase "file:/C:/Inetpub/wwwroot/classes/" {
permission java.security.AllPermission;
};
command line for sarting server was in
C:\Inetpub\wwwroot\server
in the same directory I got
client.policy file.
rmiregistry is runnig on the default port,
Have you any idea why it is so?
Regards,
Edited by: A_A_A on Nov 25, 2009 11:12 AM