JDK 17 で 8.x にアップグレードすると Confluence Data Center が起動しなくなる
プラットフォームについて: Data Center - この記事は、Data Center プラットフォームのアトラシアン製品に適用されます。
このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
要約
Confluence encountered startup issues following an upgrade to Confluence 8.x 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
環境
Confluence 8.X and JDK 17
診断
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.
原因
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.
ソリューション
To fix this problem, follow the below steps:
- 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.