• Post Reply Bookmark Topic Watch Topic
  • New Topic

connections error using rmi  RSS feed

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello guys, in first place sorry for my english :/

I need to develop a distribuited application using the RMI tecnology, but I have some issue that stop my implementation work. When I trying to rebind remothe objects the app don't work.
The error that is displayed when I try to run the application is the following:

errore java.rmi.ConnectException: Connection refused to host:; nested exception is:
java.net.ConnectException: Connection refused: connect

java.rmi.ConnectException: Connection refused to host:; nested exception is:
java.net.ConnectException: Connection refused: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:340)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:177)
at sio.SIO.main(SIO.java:34)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at java.net.Socket.<init>(Socket.java:425)
at java.net.Socket.<init>(Socket.java:208)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:146)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
... 6 more

the piece that imply this error is:

I know that is possible:
1) use a policy file that must be located in the same directory of the app with this indications:

permission java.security.AllPermission "", "";

2) it's possible modified the project's property (using Netbeans) and indicate this code in the vm options: //-DJava.security.manager -Djava.security.policy="C: etc etc /policy file"

but these equivalent solutions doesn't work, so I decided to use directly the java.policy file that is located in C:\Programmi\Java\jdk1.7.0_21\jre\lib\security. In this file I adding this code:
grant {
permission java.net.SocketPermission "localhost:1024-65535","accept, connect, listen, resolve";
permission java.net.SocketPermission "localhost:80", "connect";
permission java.net.SocketPermission "localhost:1099", "resolve,connect,accept,listen";

but I cannot bind a remothe object with the local registry, and I don't understand the motivation of this problem
someone can help me?

Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!