Connection refused to the host.
982044Dec 28 2012 — edited Dec 28 2012Hi 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)