JIRA Fails Connecting to the Database due to JavaMelody

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

Symptoms

JIRA fails to start due to failure connecting to the database. The following appears in the atlassian-jira.log:

1 2 3 4 5 6 7 2013-02-27 16:19:39,267 pool-2-thread-1 INFO [atlassian.jira.startup.JiraStartupLogger] Running JIRA startup checks. 2013-02-27 16:19:39,351 pool-2-thread-1 INFO [atlassian.jira.startup.JiraHomeStartupCheck] The jira.home directory '/home/jira' is validated and locked for exclusive use by this instance. 2013-02-27 16:19:39,351 pool-2-thread-1 INFO [atlassian.jira.startup.JiraStartupLogger] JIRA pre-database startup checks completed successfully. 2013-02-27 16:19:39,547 pool-2-thread-1 INFO [jira.config.database.SystemTenantDatabaseConfigurationLoader] Reading database configuration from /home/jira/dbconfig.xml 2013-02-27 16:19:39,627 pool-2-thread-1 INFO [jira.config.database.DatabaseConfigurationManagerImpl] Now running Database Checklist Launcher 2013-02-27 16:19:39,694 pool-2-thread-1 ERROR [NoModule] Error getting datasource via DBCP: JdbcDatasourceInfo{uri='jdbc:mysql://xxxxxxxxx:3306/jira?useUnicode=true&characterEncoding=utf8&sessionVariables=storage_engine=InnoDB', driverClassName='net.bull.javamelody.JdbcDriver', username='jiratest', password='********', isolationLevel='null', connectionProperties={driver=com.mysql.jdbc.Driver}, connectionPoolInfo=ConnectionPoolInfo{maxSize=15, minSize=2, initialSize=null, maxIdle=15, maxWait=60000, sleepTime=300000, lifeTime=600000, deadLockMaxWait=600000, deadLockRetryWait=10000, validationQuery='select 1', minEvictableTimeMillis=null, timeBetweenEvictionRunsMillis=null, poolPreparedStatements=null, testOnBorrow=null, testOnReturn=null, testWhileIdle=null, maxOpenPreparedStatements=null, numTestsPerEvictionRun=null, removeAbandonedTimeout=null, validationQueryTimeout=null, defaultCatalog=null}} org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'net.bull.javamelody.JdbcDriver' for connect URL 'jdbc:mysql://xxxxxxxxx:3306/jira-test?useUnicode=true&characterEncoding=utf8&sessionVariables=storage_engine=InnoDB'

Diagnosis

JIRA will have the driver class set to 'net.bull.javamelody.JdbcDriver' in the dbconfig.xml file:

dbconfig.xml

1 2 3 4 5 6 7 8 9 10 11 12 13 14 <?xml version="1.0" encoding="UTF-8"?> <jira-database-config>   <name>defaultDS</name>   <delegator-name>default</delegator-name>   <database-type>mysql</database-type>   <jdbc-datasource>     <url>jdbc:mysql://xxxxxxxxx:3306/jira-test?useUnicode=true&characterEncoding=utf8&sessionVariables=storage_engine=InnoDB</url>     <driver-class>net.bull.javamelody.JdbcDriver</driver-class>     <username>jiratest</username>     <password>********</password>     <pool-size>15</pool-size>     <validation-query>select 1</validation-query>   </jdbc-datasource> </jira-database-config>

Cause

This problem happens due to the use of the net.bull.javamelody.JdbcDriver Driver Class. From the JavaMelody bug report (issue-225):

It seems to me that using the javamelody JdbcDriver in dbconfig.xml does not work anymore since JIRA 5.0. And it is probably because JIRA or the ofbiz entityengine calls setDriverClassLoader on the commons dbcp datasource.

Solution

Workaround

Replace the 'net.bull.javamelody.JdbcDriver' class in the dbconfig.xml with 'com.mysql.jdbc.Driver'; following the instructions on the Connecting JIRA to MySQL documentation.

Resolution

Configure the connection to the database using a JNDI datasource as mentioned

this

and

this

comments. Also, you can see more information about how to set JavaMelody in the newer versions of JIRA in the

JavaMelody user's guide - Atlassian JIRA, Confluence and Bamboo Plugin

.

Updated on April 2, 2025

Still need help?

The Atlassian Community is here for you.