Pattern selector

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

  1. RestServer.httpRequest() has thrown a ConnectException
    Apache Kafka
    0
    0
    1
  2. Client cannot establish connection with the server
    Java Runtime
    853
    865
    748

Your stack trace compared to the selected pattern

Jump to solutionsExpand frames
java.net.ConnectException: 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)
17 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. 1tarakvia GitHub22 hours ago
    Connection refused
    Show stack trace
  2. Maxim Solodovnikvia Google Groups1 day ago
    Could not open JPA EntityManager for transaction; nested exception is <openjpa-2.2.0-r422266:1244990 fatal general error> org.apache.openjpa.persistence.PersistenceException: Cannot create PoolableConnectionFactory (Could not create connection to database server. Attempted reconnect 3 times. Giving up.)
    Show stack trace
  3. wanghaishengvia GitHub1 day ago
    Connection refused
    Show stack trace
  4. TalonOnevia GitHub2 days ago
    Connection refused
    Show stack trace
  5. einachimvia GitHub2 days ago
    ... failed and no fallback available.
    Show stack trace
  6. simon-brookevia GitHub4 days ago
    Failed to load ApplicationContext
    Show stack trace
  7. KamranAzeemvia GitHub5 days ago
    Connect to projects.example.com:443 [projects.example.com/172.20.0.4] failed: Connection refused (Connection refused)
    Show stack trace
  8. Dnhatsavevia GitHub5 days ago
    Connection refused (Connection refused)
    Show stack trace
  9. nbarrocasvia GitHub1 week ago
    localhost:10389 [Root exception is java.net.ConnectException: Connection refused]
    Show stack trace