Unable to establish connection with PostgreSQL server

java.net.ConnectException
Javadoc
Signals that an error occurred while attempting to connect a socket to a remote address and port. Typically, the connection was refused remotely (e.g., no process is listening on the remote address/port). @since JDK1.1
at java.net.PlainSocketImpl.socketConnect
(source)
at java.net.AbstractPlainSocketImpl.doConnect
(source)
at java.net.AbstractPlainSocketImpl.connectToAddress
(source)
at java.net.AbstractPlainSocketImpl.connect
(source)
at java.net.SocksSocketImpl.connect
(source)
at java.net.Socket.connect
(source)
at org.postgresql.core.PGStream.<init>
(source)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl
(source)
org.postgresql.util.PSQLException
Javadoc
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl
(source)
8 frames hidden

Typical Exception Messages

  1. Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
  2. Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
  3. Connection to 127.0.0.1:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
  4. Connection to postgres.ctmidyquyj6t.eu-central-1.rds.amazonaws.com:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
  5. Conexão negada. Verifique se o nome da máquina e a porta estão corretos e se o postmaster está aceitando conexões TCP/IP.
  6. Connection to 192.168.1.163:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
  7. Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
  8. Connection to meditorPostgres:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
  9. Connection to ec2-34-240-86-226.eu-west-1.compute.amazonaws.com:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
  10. Connection to factcast-test.c2nhv0ptpb7v.eu-central-1.rds.amazonaws.com:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.

Origin

ConnectionFactoryImpl.openConnectionImpl() has thrown a ConnectException

java.net.ConnectException
7 frames hidden
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl
23Web pages

Similar

Specific cases

Solution

rahsan, 2 months ago

There could be quite a few reasons for this type of error, for more details check this solution.

External results for this pattern (21)

  1. mictadlovia GitHub1 month ago
    Connection to 127.0.0.1:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    Show stack trace
  2. williamjacksnvia GitHub1 month ago
    Connection to server2:43831 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    Show stack trace
  3. mictadlovia GitHub1 month ago
    Connection to 127.0.0.1:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    Show stack trace
  4. nathandunnvia GitHub2 months ago
    Connection to 127.0.0.1:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    Show stack trace
  5. mictadlovia GitHub2 months ago
    Connection to 127.0.0.1:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    Show stack trace
  6. Unknown authorvia Stack Overflow2 months ago
    Conexão negada. Verifique se o nome da máquina e a porta estão corretos e se o postmaster está aceitando conexões TCP/IP.
    Show stack trace
  7. yissacharvia GitHub3 months ago
    Connection to 192.168.99.100:32771 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    Show stack trace
  8. sauravvia Stack Overflow3 months ago
    Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    Show stack trace
  9. Muatikvia Stack Overflow3 months ago
    Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    Show stack trace
  10. blackfinnvia GitHub3 months ago
    Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    Show stack trace