Unable to startup Confluence with java.net.ConnectException

Still need help?

The Atlassian Community is here for you.

Ask the community

Problem

Confluence could not be started up despite tomcat seems up from catalina.out log. The following appears in the atlassian-confluence.log:

WARN [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2] [mchange.v2.resourcepool.BasicResourcePool] run com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@5c9aa764 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: 
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
	at sun.reflect.GeneratedConstructorAccessor27.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	...
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: 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.
	at sun.reflect.GeneratedConstructorAccessor23.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	...
Caused by: java.net.ConnectException: Connection refused
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
	...

Cause

  1. DB server is down.
  2. URL in Database string is wrong
  3. The domain or hostname are not resolved to the correct server or unknown to DNS.
  4. Missing or wrong port number in JDBC URL.
  5. DB server doesn't accept TCP/IP connections.
  6. Something in between Java and DB is blocking connections, e.g. a firewall, proxy or antivirus.

Resolution

Things to check (in order):

  1. Your database is up and running
  2. Your database is reachable from the Confluence server
  3. Your authentication details are correct, you can check this via <conf-home>/confluence.cfg.xml
  4. Your traffic to the database server is not being blocked by a firewall/proxy server.
Last modified on Jun 20, 2019

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.