Confluence with JNDI Connector Crashes Under Heavy Load Due to Database Connection Issues

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Problem

Confluence frequently crashes under heavy load when using a JNDI connector and the Tomcat 8 connection pool

The following appears in the atlassian-confluence.log

atlassian-confluence.log

1 2 2015-11-24 15:38:32,626 ERROR [ContainerBackgroundProcessor[StandardEngine[Standalone]]] [sf.hibernate.util.JDBCExceptionReporter] logExceptions Cannot get a connection, general error 2015-11-24 15:39:20,591 WARN [localhost-startStop-1] [tomcat.dbcp.dbcp2.BasicDataSourceFactory] log Name = confluence Property maxActive is not used in DBCP2, use maxTotal instead. maxTotal default value is 8. You have set value of "15" for "maxActive" property, which is being ignored.

Diagnosis

Environment

  • Confluence 5.8 or above

  • Tomcat 8 or above

  • JNDI connection is being used in server.xml with maxActive

    1 2 3 4 5 <Resource name="jdbc/confluence" auth="Container" type="javax.sql.DataSource" ... maxActive="30" ... />

Cause

In Tomcat 8 the syntax for the connection pool has changed from using MaxActive to MaxTotal and the default value is 8. This can cause database connection issues.

Solution

Resolution

In conf/server.xml change maxActive to maxTotal

1 2 3 4 5 6 <Resource name="jdbc/confluence" auth="Container" type="javax.sql.DataSource" ... maxTotal="30" ... />

See Configuring a MySQL Datasource in Apache Tomcat for an example.

Updated on April 15, 2025

Still need help?

The Atlassian Community is here for you.