Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI Exception

 
Suneel Setlur
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
First Light
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Just comment the SecurityManager line and recompile. It will work fine.
Suneel
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic