java.net.ConnectException: Connection refused

MuleSoft JIRA | Alejandro Sequeira | 10 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  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 | 10 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 | 10 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

    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. Hronom 2 times, last 1 month ago
  2. batwalrus76 33 times, last 2 months ago
  3. chenjunjun 2 times, last 1 month ago
  4. Alireza Mohamadi 142 times, last 1 month ago
  5. stigkj 1 times, last 2 months ago
14 more registered users
81 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