Jira fails to start with the error 'java.lang.NullPointerException: Cannot read the array length because "this.parameterMetaData.metadata.fields" is null'

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

After a Jira upgrade, Jira fails to start, with the error java.lang.NullPointerException: Cannot read the array length because "this.parameterMetaData.metadata.fields" is null.

Environment

So far, this error has only been observed when upgrading Jira to versions 9.11 or 9.12 while using MySQL 5.7 and version 5.1.47 of the MySQL Java driver.

Diagnosis

The following error is observed in the logs when starting Jira:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 2024-01-01 00:00:00,000+0000 JIRA-Bootstrap ERROR [c.a.jira.startup.LauncherContextListener] Unable to start JIRA. java.lang.NullPointerException: Cannot read the array length because "this.parameterMetaData.metadata.fields" is null at com.mysql.jdbc.PreparedStatement.setTimestamp(PreparedStatement.java:4241) at org.apache.commons.dbcp2.DelegatingPreparedStatement.setTimestamp(DelegatingPreparedStatement.java:646) at org.apache.commons.dbcp2.DelegatingPreparedStatement.setTimestamp(DelegatingPreparedStatement.java:646) at com.atlassian.jira.ofbiz.sql.PreparedStatementWrapper.setTimestamp(PreparedStatementWrapper.java:117) at org.ofbiz.core.entity.jdbc.SQLProcessor.setValue(SQLProcessor.java:777) at org.ofbiz.core.entity.jdbc.SqlJdbcUtil.setValue(SqlJdbcUtil.java:806) at org.ofbiz.core.entity.jdbc.SqlJdbcUtil.setValue(SqlJdbcUtil.java:767) at org.ofbiz.core.entity.jdbc.SqlJdbcUtil.setValues(SqlJdbcUtil.java:563) at org.ofbiz.core.entity.GenericDAO.singleInsert(GenericDAO.java:202) at org.ofbiz.core.entity.GenericDAO.insert(GenericDAO.java:176) at org.ofbiz.core.entity.GenericHelperDAO.create(GenericHelperDAO.java:89) at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:566) at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:552) at org.ofbiz.core.entity.GenericValue.create(GenericValue.java:114) at com.atlassian.jira.ofbiz.DefaultOfBizDelegator.createValue(DefaultOfBizDelegator.java:296) at com.atlassian.jira.ofbiz.WrappingOfBizDelegator.createValue(WrappingOfBizDelegator.java:172) at com.atlassian.jira.plugin.OfBizPluginVersionStore.create(OfBizPluginVersionStore.java:43) at com.atlassian.jira.plugin.JiraPluginManager.processAddedPlugins(JiraPluginManager.java:377) at com.atlassian.jira.plugin.JiraPluginManager.processPluginSystemChanges(JiraPluginManager.java:351) at com.atlassian.jira.plugin.JiraPluginManager.lateStartup(JiraPluginManager.java:135) at com.atlassian.jira.component.pico.ComponentManager$PluginSystem.lateStartup(ComponentManager.java:697) at com.atlassian.jira.component.pico.ComponentManager.lateStartPluginSystem(ComponentManager.java:304) at com.atlassian.jira.upgrade.PluginSystemLauncher.lateStart(PluginSystemLauncher.java:66) at com.atlassian.jira.startup.DefaultJiraLauncher.postDBActivated(DefaultJiraLauncher.java:175) at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$postDbLaunch$2(DefaultJiraLauncher.java:150) at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrEnqueue(DatabaseConfigurationManagerImpl.java:305) at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrWhenDatabaseActivated(DatabaseConfigurationManagerImpl.java:202) at com.atlassian.jira.startup.DefaultJiraLauncher.postDbLaunch(DefaultJiraLauncher.java:141) at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$start$0(DefaultJiraLauncher.java:107) at com.atlassian.jira.util.devspeed.JiraDevSpeedTimer.run(JiraDevSpeedTimer.java:31) at com.atlassian.jira.startup.DefaultJiraLauncher.start(DefaultJiraLauncher.java:105) at com.atlassian.jira.startup.LauncherContextListener.initSlowStuff(LauncherContextListener.java:154) at java.base/java.lang.Thread.run(Unknown Source)

Cause

The cause of the error is a bug in version 5.1.47 of the MySQL Java driver.

Solution

Upgrade to MySQL 8.0 and the MySQL Connector/J 8.0 driver. Support for MySQL 5.7 was officially removed beginning with Jira 9.2, as stated in our August 2022 End of support announcements.

If it's not possible to upgrade to MySQL 8.0 immediately then a short-term workaround is to upgrade only the MySQL Connector/J 8.0 driver; however, we would still strongly recommend scheduling an upgrade to MySQL 8.0 as soon as possible, to ensure that your Jira instance will be fully supported.

Updated on March 6, 2025

Still need help?

The Atlassian Community is here for you.