| Author |
Connection Refused Exception
|
paddy Mahadeva Iyer
Ranch Hand
Joined: Feb 10, 2007
Posts: 63
|
|
Hi, I am working on a application that tries to send out a message to server . but when the system tries to post to the server it gets the following exception java.net.ConnectException: Connection refused 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.Socket.connect(Socket.java:519) at java.net.Socket.connect(Socket.java:469) at sun.net.NetworkClient.doConnect(NetworkClient.java:157) at sun.net.www.http.HttpClient.openServer(HttpClient.java:382) at sun.net.www.http.HttpClient.openServer(HttpClient.java:494) at sun.net.www.http.HttpClient.<init>(HttpClient.java:231) at sun.net.www.http.HttpClient.New(HttpClient.java:304) at sun.net.www.http.HttpClient.New(HttpClient.java:316) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:817) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:769) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:694) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:861) I found that the excption is being triggerd from my code in a line where an attempt to get an outputstream is made with the httpurlconnection object. Can somebody tell me what are the probable causes of such an exception?
|
 |
Joe Ess
Bartender
Joined: Oct 29, 2001
Posts: 8290
|
|
|
The most common causes are a firewall between your server and client or the server is not listening. Can you open the same URL with a browser?
|
"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
|
 |
paddy Mahadeva Iyer
Ranch Hand
Joined: Feb 10, 2007
Posts: 63
|
|
|
no i cannot!
|
 |
Joe Ess
Bartender
Joined: Oct 29, 2001
Posts: 8290
|
|
|
Can you ping the server?
|
 |
 |
|
|
subject: Connection Refused Exception
|
|
|