Skip to Main Content

Java Programming

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 Exception- chat application

807580Jul 11 2010 — edited Jul 11 2010
I am developing a chat application comprising of a multi-threaded server running (obviously) many clients at a time.

I am able to establish the connection between the server and the client(s) on my own machine.
The problem is, when i place the server on my friend's machine, it throws a "*Connection refused Exception*"

The complete error, as seen in Netbeans is

java.net.ConnectException: Connection refused: 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:529)
at java.net.Socket.connect(Socket.java:478)
at java.net.Socket.<init>(Socket.java:375)
at java.net.Socket.<init>(Socket.java:218)
at NewClient.connectToServer(NewClient.java:188)
at NewClient.runClient(NewClient.java:168)
at NewClientTest.main(NewClientTest.java:10)
Exception in thread "main" java.lang.NullPointerException
at NewClient.closeConnection(NewClient.java:220)
at NewClient.runClient(NewClient.java:181)
at NewClientTest.main(NewClientTest.java:10)




I'm running it on port 4000 which's been added to the list of exceptions on the Window's firewall.
Since it didn't work out, i disabled the firewall itself.
My friend did likewise.

Can someone please decipher this error for me?

P.S: Please help :(
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 8 2010
Added on Jul 11 2010
1 comment
288 views