java.rmi.ConnectException: Connection refused to host:

Hi,

I have created a RMI chat program and it works on my laptop. I have tried running it across mine and another laptop both use XP home edition. However we are getting the following error:

I know the code is correct because it has worked once but I am not sure why it is sometimes not connecting. Any suggestions would be great.

java.rmi.ConnectException: Connection refused to host: 172.16.208.154; nested exception is:

java.net.ConnectException: Connection timed out: connect

at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)

at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)

at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)

at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)

at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)

at java.rmi.Naming.lookup(Naming.java:84)

at Assignment.ChatClient2.ServerLogon(ChatClient2.java:116)

at Assignment.Messenger.<init>(Messenger.java:46)

at Assignment.Messenger.main(Messenger.java:302)

Caused by: java.net.ConnectException: Connection timed out: connect

at java.net.PlainSocketImpl.socketConnect(Native Method)

at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)

at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)

at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)

at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)

at java.net.Socket.connect(Socket.java:519)

at java.net.Socket.connect(Socket.java:469)

at java.net.Socket.<init>(Socket.java:366)

at java.net.Socket.<init>(Socket.java:179)

at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)

at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)

at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)

... 8 more

Many thanks!!

[2049 byte] By [tbr_84a] at [2007-11-26 15:08:34]
# 1
You have a connectivity problem, not an RMI problem. Can you ping that host from the client?
ejpa at 2007-7-8 8:58:59 > top of Java-index,Core,Core APIs...
# 2
May be u have to check the firewall settings. Its not allowing to use the port where rmi server is running...
The_java_guya at 2007-7-8 8:58:59 > top of Java-index,Core,Core APIs...