java.net.ConnectException: Connection refused

MuleSoft JIRA | Alejandro Sequeira | 11 months ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to rafael . Or join the community to write better ones.
  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 | 11 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 | 11 months ago | Alejandro Sequeira
    java.net.ConnectException: Connection refused
  3. 0

    NullPayload exception - MuleSoft

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

    Automated exception search integrated into your IDE

  5. 0
    samebug tip
    This was a bug at HBase 1.0.1, it has been patched, so an update to 1.0.2 or further should solve the problem. URL for the Jira thread: https://goo.gl/c5oa6f
  6. 0

    Hadoop HA setup : not able to connect to zookeeper

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

  1. jstrayer 2 times, last 2 days ago
  2. chenjunjun 1 times, last 1 week ago
  3. Hronom 2 times, last 2 months ago
  4. batwalrus76 33 times, last 3 months ago
  5. Alireza Mohamadi 142 times, last 2 months ago
15 more registered users
80 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