Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Connection refused to the host.

982044Dec 28 2012 — edited Dec 28 2012
Hi can anybody help me to solve this problem ...
I am getting following exception while executing this program

package rmiDemo;

import java.rmi.Naming;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

public class RMIDemoServer {

public static void main(String[] args) throws Exception{
RMIDemoImpl rmiDemoImpl = new RMIDemoImpl();
Naming.rebind("RMIDemo",rmiDemoImpl);
System.out.println("hi");
}

}

I am starting RMI registry thr command prompt using command "java rmiDemo.RMIDemoServer"


Please Help

Exception :
Exception in thread "main" java.rmi.ConnectException: Connection refused to host
: 192.168.1.14; nested exception is:
java.net.ConnectException: Connection refused: connect
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 rmiDemo.RMIDemoServer.main(RMIDemoServer.java:11)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 25 2013
Added on Dec 28 2012
2 comments
4,224 views