Two Laptop Bag*
The moose likes JDBC and the fly likes java.net.ConnectException: Connection refused: connect Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "java.net.ConnectException: Connection refused: connect" Watch "java.net.ConnectException: Connection refused: connect" New topic
Author

java.net.ConnectException: Connection refused: connect

nav katoch
Ranch Hand

Joined: May 02, 2008
Posts: 246

Hi all,

I had been using these eclipse indigo, oracle 11, and weblogic 9.2. I upgraded from Eclipse Indigo to Juno. Now my server debugger has started giving the following stack trace and the weblogic crashes:
-
|BL:|TS:8/2/12 9:15:25 AM EDT|LL:FATAL |TM:10.6.220.27-1343912944878|CN:com.techrx.model.service.net.ValidatingConnection|MT:getInputStream|MSG:Error with establishing connection|EX:
Exception 941041217
java.net.ConnectException
at com.techrx.model.service.net.ValidatingConnection.getInputStream(ValidatingConnection.java:236)
at com.techrx.model.service.ServiceThread$Job.run(ServiceThread.java:92)
at com.techrx.util.DefaultThreadPool.run(DefaultThreadPool.java:185)
at java.lang.Thread.run(Thread.java:595)

-
|BL:|TS:8/2/12 9:15:25 AM EDT|LL:SEVERE|TM:10.6.220.27-1343912944878|CN:com.techrx.model.service.ServiceInvocationHandler|MT:handleRunError()|MSG:Exception caught by RemoteHandler|EX:
Exception 376917531
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.Socket.connect(Socket.java:524)
at sun.net.NetworkClient.doConnect(NetworkClient.java:155)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:388)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:523)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:640)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:983)
at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:1993)
at java.net.URLConnection.getContentType(URLConnection.java:479)
at com.techrx.model.service.net.ValidatingConnection.getInputStream(ValidatingConnection.java:235)
java.net.ConnectException: Connection refused: connect
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:501)
at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1250)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1244)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:932)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:367)
at com.techrx.model.service.net.ValidatingConnection.getInputStream(ValidatingConnection.java:307)
at com.techrx.model.service.ServiceThread$Job.run(ServiceThread.java:92)
at com.techrx.util.DefaultThreadPool.run(DefaultThreadPool.java:185)
at java.lang.Thread.run(Thread.java:595)

Please help me out to fix this issue.

Thanks for your time,

Naveen Katoch
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

It's just the same as the thousands of other people who have had that same problem with the identical error message. You're trying to connect to a database server which isn't running, or you didn't get the address or port correct when you tried to connect, or there's a firewall or some other network appliance blocking the connection.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: java.net.ConnectException: Connection refused: connect
 
Similar Threads
I have implemented SSO when admin login i am getting Exception
How to get response content of a website
java.net.ConnectionException
HttpURLConnection
javawebstart