Pattern selector

Most relevant patterns first. Most helpful ones displayed. Click here to show all.

  1. Socket.<init>() has thrown a ConnectException
    Java Runtime
    150
    146
    65
  2. Client cannot establish connection with the server
    Java Runtime
    853
    866
    748

Your stack trace compared to the selected pattern

Jump to solutionsExpand frames
java.net.ConnectException: Connection refused (Connection refused)
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
5 frames hidden

Solution

poroszd4 months ago

Roughly there are three categories of this problem:

  • no network available: Probably your machine's network interface is down. Check if you have internet and your application has permissions to use the network interface
  • connection refused: The address you are trying to connect is not listening. Check if you did not misspelled the host or the port. Also verify that the server you are trying to reach is actually running and listening.
  • connection timed out: The server took too much time to respond. You either have to increase the timeout limit or speed up the server.

External results for this pattern (10)

  1. teotia39via GitHub22 hours ago
    Connection timed out (Connection timed out)
    Show stack trace
  2. ing-arriolavia GitHub22 hours ago
    Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Cannot create PoolableConnectionFactory (Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.)
    Show stack trace
  3. hiteshbargujarvia GitHub23 hours ago
    Could not locate PropertySource and the fail fast property is set, failing
    Show stack trace
  4. telangnvia GitHub1 day ago
    Connection refused (Connection refused) Build info: version: '3.5.2', revision: '10229a9', time: '2017-08-21T17:29:55.15Z' System info: host: 'ninad-Gazelle', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.10.0-42-generic', java.version: '1.8.0_151' Driver info: driver.version: AndroidDriver
    Show stack trace
  5. macko-tiporvia GitHub1 day ago
    Connection timed out (Connection timed out)
    Show stack trace
  6. anti1234via GitHub1 day ago
    Connection timed out
    Show stack trace
  7. pandeymradulvia GitHub1 day ago
    Could not obtain access token
    Show stack trace
  8. dizzzzvia GitHub1 day ago
    Connection timed out
    Show stack trace
  9. Maegnervia GitHub1 day ago
    java.net.ConnectException: Connection refused (Connection refused)
    Show stack trace