org.postgresql.util.PSQLException: The connection attempt failed.

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Stack Overflow by Drux
, 1 year ago
via Stack Overflow by Marc Polizzi
, 10 months ago
The connection attempt failed.
via GitHub by edrdo
, 4 months ago
Connection to localhost:1047 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
via Stack Overflow by hywy
, 1 year ago
java.net.UnknownHostException: postgres-service
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.postgresql.core.PGStream.(PGStream.java:64)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:150)
at org.postgresql.jdbc.PgConnection.(PgConnection.java:211)
at org.postgresql.Driver.makeConnection(Driver.java:407)
at org.postgresql.Driver.connect(Driver.java:275)
at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:661)
at org.apache.catalina.realm.JDBCRealm.startInternal(JDBCRealm.java:724)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5054)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:596)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Users with the same issue

9 times, 2 days ago
Once, 5 days ago
Once, 1 week ago
3 times, 2 weeks ago
Once, 1 month ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.