Can't access Confluence - "StringIndexOutOfBoundsException" message is displayed

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

When starting Confluence, the application will not launch correctly.

When trying to access it from a browser, the following error message will be displayed:

(Auto-migrated image: description temporarily unavailable)

Environment

Confluence Server or Data Center (any version).

Diagnosis

Checking the application logs, in <confluence_home>/logs/atlassian-confluence.log, the following error is present:

atlassian-confluence.log

1 2020-08-31 18:42:11,147 ERROR [Catalina-utility-1] [atlassian.confluence.setup.ConfluenceConfigurationListener] contextInitialized An error was encountered while bootstrapping Confluence (see below): java.lang.StringIndexOutOfBoundsException: begin 0, end 15403, length 502 com.atlassian.extras.common.LicenseException: java.lang.StringIndexOutOfBoundsException: begin 0, end 15403, length 502

Cause

This message indicates that the license code Confluence is currently using may be invalid, or corrupted.

The Confluence license key is stored in the <confluence_home>/confluence.cfg.xml file. To check for any issues, look for the following property:

1 <property name="atlassian.license.message">Your License Code Here</property>

Compare the license code listed here, with the original license code used on this Confluence instance, and make sure both codes match.

ℹ️ You can check any current licenses associated with an Atlassian account by accessing the My Atlassian portal.

Solution

  1. Stop Confluence

  2. Copy the Confluence license code to the clipboard

  3. Replace the current code inside the confluence.cfg.xml file with the copied content

  4. Start Confluence

Confluence should be able to validate this license now.

com.atlassian.extras.common.LicenseException: java.lang.StringIndexOutOfBoundsException

Updated on April 11, 2025

Still need help?

The Atlassian Community is here for you.