java.net.ConnectException: Connection refused

MuleSoft JIRA | Alejandro Sequeira | 8 months ago
  1. 0

    When executing an HTTP request to a non available socket the error shown in the log says that it is an HTTP request error but doesn't mention a connection timeout or connection refused problem. See the log below: {noformat} ******************************************************************************** Message : Error sending HTTP request. Element : null -------------------------------------------------------------------------------- Exception stack is: Error sending HTTP request. (org.mule.api.MessagingException) sun.nio.ch.SocketChannelImpl.checkConnect:-2) sun.nio.ch.SocketChannelImpl.finishConnect:717) org.glassfish.grizzly.nio.transport.TCPNIOConnectorHandler.onConnectedAsync:210) org.glassfish.grizzly.nio.transport.TCPNIOConnectorHandler$1.connected:158) org.glassfish.grizzly.nio.transport.TCPNIOConnection.onConnect:258) org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent:517) org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent:112) org.mule.module.http.internal.request.grizzly.FlowWorkManagerIOStrategy.run0:134) org.mule.module.http.internal.request.grizzly.FlowWorkManagerIOStrategy.executeIoEvent:77) org.glassfish.grizzly.strategies.AbstractIOStrategy.executeIoEvent:89) org.glassfish.grizzly.nio.SelectorRunner.iterateKeyEvents:415) org.glassfish.grizzly.nio.SelectorRunner.iterateKeys:384) org.glassfish.grizzly.nio.SelectorRunner.doSelect:348) org.glassfish.grizzly.nio.SelectorRunner.run:279) org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork:591) org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run:571) java.lang.Thread.run:745) (set debug level logging or '-Dmule.verbose.exceptions=true' for everything) ******************************************************************************** {noformat} The only way to get the right error information is using {{mule.verbose.exceptions=true}}, see below: {noformat} ******************************************************************************** Message : Error sending HTTP request. Payload : 1 Payload Type : java.lang.String -------------------------------------------------------------------------------- Root Exception stack trace: java.net.ConnectException: Connection refused at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) at org.glassfish.grizzly.nio.transport.TCPNIOConnectorHandler.onConnectedAsync(TCPNIOConnectorHandler.java:210) at org.glassfish.grizzly.nio.transport.TCPNIOConnectorHandler$1.connected(TCPNIOConnectorHandler.java:158) at org.glassfish.grizzly.nio.transport.TCPNIOConnection.onConnect(TCPNIOConnection.java:258) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:517) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112) at org.mule.module.http.internal.request.grizzly.FlowWorkManagerIOStrategy.run0(FlowWorkManagerIOStrategy.java:134) at org.mule.module.http.internal.request.grizzly.FlowWorkManagerIOStrategy.executeIoEvent(FlowWorkManagerIOStrategy.java:77) at org.glassfish.grizzly.strategies.AbstractIOStrategy.executeIoEvent(AbstractIOStrategy.java:89) at org.glassfish.grizzly.nio.SelectorRunner.iterateKeyEvents(SelectorRunner.java:415) at org.glassfish.grizzly.nio.SelectorRunner.iterateKeys(SelectorRunner.java:384) at org.glassfish.grizzly.nio.SelectorRunner.doSelect(SelectorRunner.java:348) at org.glassfish.grizzly.nio.SelectorRunner.run(SelectorRunner.java:279) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571) at java.lang.Thread.run(Thread.java:745) ******************************************************************************** {noformat}

    MuleSoft JIRA | 8 months ago | Alejandro Sequeira
    java.net.ConnectException: Connection refused
  2. 0

    When executing an HTTP request to a non available socket the error shown in the log says that it is an HTTP request error but doesn't mention a connection timeout or connection refused problem. See the log below: {noformat} ******************************************************************************** Message : Error sending HTTP request. Element : null -------------------------------------------------------------------------------- Exception stack is: Error sending HTTP request. (org.mule.api.MessagingException) sun.nio.ch.SocketChannelImpl.checkConnect:-2) sun.nio.ch.SocketChannelImpl.finishConnect:717) org.glassfish.grizzly.nio.transport.TCPNIOConnectorHandler.onConnectedAsync:210) org.glassfish.grizzly.nio.transport.TCPNIOConnectorHandler$1.connected:158) org.glassfish.grizzly.nio.transport.TCPNIOConnection.onConnect:258) org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent:517) org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent:112) org.mule.module.http.internal.request.grizzly.FlowWorkManagerIOStrategy.run0:134) org.mule.module.http.internal.request.grizzly.FlowWorkManagerIOStrategy.executeIoEvent:77) org.glassfish.grizzly.strategies.AbstractIOStrategy.executeIoEvent:89) org.glassfish.grizzly.nio.SelectorRunner.iterateKeyEvents:415) org.glassfish.grizzly.nio.SelectorRunner.iterateKeys:384) org.glassfish.grizzly.nio.SelectorRunner.doSelect:348) org.glassfish.grizzly.nio.SelectorRunner.run:279) org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork:591) org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run:571) java.lang.Thread.run:745) (set debug level logging or '-Dmule.verbose.exceptions=true' for everything) ******************************************************************************** {noformat} The only way to get the right error information is using {{mule.verbose.exceptions=true}}, see below: {noformat} ******************************************************************************** Message : Error sending HTTP request. Payload : 1 Payload Type : java.lang.String -------------------------------------------------------------------------------- Root Exception stack trace: java.net.ConnectException: Connection refused at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) at org.glassfish.grizzly.nio.transport.TCPNIOConnectorHandler.onConnectedAsync(TCPNIOConnectorHandler.java:210) at org.glassfish.grizzly.nio.transport.TCPNIOConnectorHandler$1.connected(TCPNIOConnectorHandler.java:158) at org.glassfish.grizzly.nio.transport.TCPNIOConnection.onConnect(TCPNIOConnection.java:258) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:517) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112) at org.mule.module.http.internal.request.grizzly.FlowWorkManagerIOStrategy.run0(FlowWorkManagerIOStrategy.java:134) at org.mule.module.http.internal.request.grizzly.FlowWorkManagerIOStrategy.executeIoEvent(FlowWorkManagerIOStrategy.java:77) at org.glassfish.grizzly.strategies.AbstractIOStrategy.executeIoEvent(AbstractIOStrategy.java:89) at org.glassfish.grizzly.nio.SelectorRunner.iterateKeyEvents(SelectorRunner.java:415) at org.glassfish.grizzly.nio.SelectorRunner.iterateKeys(SelectorRunner.java:384) at org.glassfish.grizzly.nio.SelectorRunner.doSelect(SelectorRunner.java:348) at org.glassfish.grizzly.nio.SelectorRunner.run(SelectorRunner.java:279) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571) at java.lang.Thread.run(Thread.java:745) ******************************************************************************** {noformat}

    MuleSoft JIRA | 8 months ago | Alejandro Sequeira
    java.net.ConnectException: Connection refused
  3. 0

    NullPayload exception - MuleSoft

    mulesoft.com | 1 month ago
    java.net.ConnectException: Connection refused: no further information
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Hadoop HA setup : not able to connect to zookeeper

    Stack Overflow | 2 years ago
    java.net.ConnectException: Connection refused
  6. 0

    Run Hbase example in eclipse on ubuntu

    Stack Overflow | 2 years ago
    java.net.ConnectException: Connection refused

  1. RoiOtero 525 times, last 2 weeks ago
  2. nasimk 1595 times, last 4 days ago
  3. gehel 8 times, last 1 month ago
  4. rp 1 times, last 2 months ago
  5. poroszd 4 times, last 2 months ago
10 more registered users
85 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.net.ConnectException

    Connection refused

    at sun.nio.ch.SocketChannelImpl.checkConnect()
  2. Java RT
    SocketChannelImpl.finishConnect
    1. sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    2. sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
    2 frames
  3. Grizzly
    AbstractIOStrategy.fireIOEvent
    1. org.glassfish.grizzly.nio.transport.TCPNIOConnectorHandler.onConnectedAsync(TCPNIOConnectorHandler.java:210)
    2. org.glassfish.grizzly.nio.transport.TCPNIOConnectorHandler$1.connected(TCPNIOConnectorHandler.java:158)
    3. org.glassfish.grizzly.nio.transport.TCPNIOConnection.onConnect(TCPNIOConnection.java:258)
    4. org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:517)
    5. org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
    5 frames
  4. Mule HTTP Connector
    FlowWorkManagerIOStrategy.executeIoEvent
    1. org.mule.module.http.internal.request.grizzly.FlowWorkManagerIOStrategy.run0(FlowWorkManagerIOStrategy.java:134)
    2. org.mule.module.http.internal.request.grizzly.FlowWorkManagerIOStrategy.executeIoEvent(FlowWorkManagerIOStrategy.java:77)
    2 frames
  5. Grizzly
    AbstractThreadPool$Worker.run
    1. org.glassfish.grizzly.strategies.AbstractIOStrategy.executeIoEvent(AbstractIOStrategy.java:89)
    2. org.glassfish.grizzly.nio.SelectorRunner.iterateKeyEvents(SelectorRunner.java:415)
    3. org.glassfish.grizzly.nio.SelectorRunner.iterateKeys(SelectorRunner.java:384)
    4. org.glassfish.grizzly.nio.SelectorRunner.doSelect(SelectorRunner.java:348)
    5. org.glassfish.grizzly.nio.SelectorRunner.run(SelectorRunner.java:279)
    6. org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591)
    7. org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)
    7 frames
  6. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:745)
    1 frame