Confluence Data Center fails to start after being upgraded to 8.x or newer with JDK 17
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles 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
Confluence encountered startup issues following an upgrade to Confluence 8.x or newer while operating on JDK 17. This was due to an inability to access specific Java 17 classes, such as sun.util.calendar.ZoneInfo
, resulting in Confluence failing to initiate.
To address this, Confluence now incorporates a system property within the setenv.sh
file that directs to the jpms-args.txt
file located at $CATALINA_HOME/confluence/WEB-INF/
. However, there have been instances where users have replaced this updated setenv.sh
file with an older version (7.19 or earlier) lacking this crucial property. Consequently, Confluence may encounter startup issues and log an error referencing /500page.jsp.
org.apache.velocity.exception.VelocityException: ASTIdentifier() : exception invoking method for identifier 'rawOffset' in class sun.util.calendar.ZoneInfo
java.lang.RuntimeException: javax.servlet.ServletException: org.apache.velocity.exception.VelocityException: ASTIdentifier() : exception invoking method for identifier 'rawOffset' in class sun.util.calendar.ZoneInfo
Environment
Confluence 8.X or newer and JDK 17
Diagnosis
To identify the issue, please check the logs and locate the following error messages in atlasian-confluence.log
:
org.apache.velocity.exception.VelocityException: ASTIdentifier() : exception invoking method for identifier 'rawOffset' in class sun.util.calendar.ZoneInfo
java.lang.RuntimeException: javax.servlet.ServletException: org.apache.velocity.exception.VelocityException: ASTIdentifier() : exception invoking method for identifier 'rawOffset' in class sun.util.calendar.ZoneInfo
If the error logs mentioned above are present, check the setenv.sh
file for the following property:
CATALINA_OPTS="@$CATALINA_HOME/confluence/WEB-INF/jpms-args.txt ${CATALINA_OPTS}"
If the above property is present in the setenv.sh
file, check for the existence of the jpms-args.txt
file in the $CATALINA_HOME/confluence/WEB-INF
directory and ensure that it has proper permissions.
Cause
Due to stronger encapsulation in JDK 17, Confluence is unable to access certain Java 17 classes (e.g., sun.util.calendar.ZoneInfo). This results in errors.
Solution
To fix this problem, follow the below steps:
- Stop Confluence
If the
setenv.sh
file is missing the following system property, it needs to be added.CATALINA_OPTS="@$CATALINA_HOME/confluence/WEB-INF/jpms-args.txt ${CATALINA_OPTS}"
- Start the Confluence.
If you have added the above property in the setenv.sh
file, but still encountering the same error message, then you should check the jpms-args.txt
file in the $CATALINA_HOME/confluence/WEB-INF
directory. Verify if the file has appropriate permissions, or if it is missing, create a new file named "jpms-args.txt". Then, add the following entries in the file, save it, and update the file permissions accordingly and restart the Confluence again.
# Add various JPMS arguments to allow Confluence to work on Java 17.
# These also work with Java 11, but are optional.
--add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/java.lang.reflect=ALL-UNNAMED
--add-opens java.base/java.net=ALL-UNNAMED
--add-opens java.base/java.io=ALL-UNNAMED
--add-opens java.base/java.util=ALL-UNNAMED
--add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED
--add-opens java.base/sun.net.www.protocol.jar=ALL-UNNAMED
--add-opens java.base/sun.net.www.protocol.http=ALL-UNNAMED
--add-opens java.base/sun.net.www.protocol.https=ALL-UNNAMED
--add-opens java.base/sun.util.locale=ALL-UNNAMED
--add-opens java.management/javax.management=ALL-UNNAMED
--add-exports java.base/sun.security.action=ALL-UNNAMED
--add-exports java.base/sun.util.calendar=ALL-UNNAMED
--add-exports java.naming/com.sun.jndi.ldap=ALL-UNNAMED
--add-exports java.xml/com.sun.org.apache.xml.internal.utils=ALL-UNNAMED
--add-exports java.desktop/sun.font=ALL-UNNAMED
--add-exports java.base/sun.security.util=ALL-UNNAMED
Note : Please perform the above steps across all the nodes if you are running more than one node in a cluster.