aspose file tools*
The moose likes Distributed Java and the fly likes RMI Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "RMI Exception" Watch "RMI Exception" New topic
Author

RMI Exception

Suneel Setlur
Ranch Hand

Joined: Nov 26, 2000
Posts: 202
Hi ,
I am getting the following error while working with a simple Hello program for RMI.I am working on Windows NT.
This error occurs when i am trying to start the server.
Could anyone tell me what is going wrong.
C:\rahul\SERVER1>java rahul.HelloImpl
Initialising server please wait
HelloImpl err: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)
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.<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.rebind(Unknown Source)
at java.rmi.Naming.rebind(Unknown Source)
at rahul.HelloImpl.main(HelloImpl.java:25)
The programs are as follows

------------------
Suneel
[This message has been edited by Suneel Setlur (edited December 13, 2000).]


Suneel
First Light
Greenhorn

Joined: Nov 27, 2000
Posts: 14
Reason: You did not specify the policy file on the command line should be something like:
java -cp . -Djava.security.policy=policyfile myprogram
akshay mahajan
Greenhorn

Joined: Jan 18, 2001
Posts: 10
i am haveing the same problem. the diff is that the problem is coming when i am running the client program from diff machine & try to access the client m/c
Error is
java.security.AccessControl.Exception(IP:socket).....
Also i am trying to connect thru the aPPLET.
You have clarified the doubt But what should be the content of the policyfile & where should it be stored???
asad ali
Greenhorn

Joined: Dec 12, 2000
Posts: 20
Check the following link for contents of policy file http://java.sun.com/products/jdk/1.2/docs/guide/security/permissions.html
Suneel Setlur
Ranch Hand

Joined: Nov 26, 2000
Posts: 202
Hi
Just comment the SecurityManager line and recompile. It will work fine.
Suneel
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RMI Exception