Hi Sir, I tried the example from below URL. http://developer.java.sun.com/developer/JDCTechTips/2001/tt0227.html#dynamic I encounter the following error message when i run the client program. Below is the error message. C:\jdk1.3.1\Article_eg\test_2>set CLASSPATH=c:\jdk1.3.1\Article_eg\test_2\Client;c:\jdk1.3.1\Article_eg\test_2\Client\EchoClient C:\jdk1.3.1\Article_eg\test_2>java -cp Client \ -Dsun.rmi.loader.logLevel=VERBOSE \ -Djava.security.policy=Client/SimpleRMI.policy \ -Djava.security.manager EchoClient Connecting to echo server... java.security.AccessControlException: access denied (java.net.SocketPermission 127.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.<init>(Unknown Source) at java.net.Socket.<init>(Unknown Source)at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown Source)at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown Source)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 java.rmi.Naming.lookup(Unknown Source) at EchoClient.main(EchoClient.java:7) C:\jdk1.3.1\Article_eg\test_2>
Here is the content of the SimpleRMI.policy file. grant { permission java.net.SocketPermission" *:1024-", "accept, connect"; permission java.io.FilePermission "${/}c${/}jdk1.3.1${/}Article_eg${/}test_2${/}Client${/}-", "read"; }; I am new in RMI. Can anyone of you please help me? What's wrong ? Thank you in advance.
Kunal Aher
Greenhorn
Joined: Apr 07, 2000
Posts: 20
posted
0
Have u tried giving all permissions to your code base ??
Kunal
Charlotte Niy
Greenhorn
Joined: Jun 28, 2001
Posts: 3
posted
0
Thanks, I have the permission and it is fine now. Thanks for your help.