-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
9.15.0, 9.12.6, 9.16.0, 9.17.0
-
9.12
-
2
-
Severity 2 - Major
-
18
-
Issue Summary
Jira may not start with Java 17 on Linux when the Java location is brought by the PATH environment variable.
Steps to Reproduce
- Download Adoptium JDK 11.
- Add the <jdk11-home>/bin directory to the PATH variable.
export PATH=<jdk11-home>/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
- Don't set JAVA_HOME nor JRE_HOME environment variables.
unset JAVA_HOME unset JRE_HOME
- Install a vanilla instance of Jira using the tar.gz.
- Start Jira with the start-jira.sh script.
- Note Jira recognizes the java binary and starts properly without any error.
- Stop Jira.
- Download Adoptium JDK 17.
- Add the <jdk17-home>/bin directory to the PATH variable.
export PATH=<jdk17-home>/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
- Start Jira with the start-jira.sh script.
Expected Results
Jira starts properly without any error.
Actual Results
Jira fails to start properly because it's unable to include necessary --add-opens and --add-exports properties.
The startup scripts properly identify the Java binary as below.
$ ./start-jira.sh To run Jira in the foreground, start the server with start-jira.sh -fg executing as current user `sMMMMMMMMMMMMMM+ MMMMMMMMMMMMMM :sdMMMMMMMMMMM MMMMMM `sMMMMMMMMMMMMMM+ MMMMMM MMMMMMMMMMMMMM +MMMMM :sMMMMMMMMMMM MMMMM MMMMMM `UOJ `sMMMMMMMMMMMMM+ MMMMMM MMMMMMMMMMMMMM +MMMMM :sdMMMMMMMMMM MMMMM MMMMMM `UOJ MMMMMM +MMMMM MMMMM `UOJ Atlassian Jira Version : 9.12.10 If you encounter issues starting or stopping Jira, please see the Troubleshooting guide at https://docs.atlassian.com/jira/jadm-docs-0912/Troubleshooting+installation Using JIRA_HOME: /var/atlassian/application-data/jira/ Server startup logs are located in /opt/atlassian/jira/current/logs/catalina.out Using CATALINA_BASE: /opt/atlassian/jira/current Using CATALINA_HOME: /opt/atlassian/jira/current Using CATALINA_TMPDIR: /var/atlassian/application-data/jira//temp Using JRE_HOME: /opt/atlassian/jira/jdk-17.0.12+7 Using CLASSPATH: /opt/atlassian/jira/current/bin/bootstrap.jar:/opt/atlassian/jira/current/bin/tomcat-juli.jar Using CATALINA_OPTS: Using CATALINA_PID: /opt/atlassian/jira/current/work/catalina.pid Tomcat started.
Looking at the Tomcat logs we have an error similar to the below.
2024-07-30 12:15:06,981+0000 main ERROR [c.a.jira.startup.ComponentContainerLauncher] An Error occurred during ComponentContainerLauncher servlet context initialisation - class com.atlassian.jira.issue.customfields.manager.xml.AllowlistedXStreamFactory (in unnamed module @0x534fc1f7) cannot access class sun.util.calendar.BaseCalendar$Date (in module java.base) because module java.base does not export sun.util.calendar to unnamed module @0x534fc1f7. java.lang.IllegalAccessError: class com.atlassian.jira.issue.customfields.manager.xml.AllowlistedXStreamFactory (in unnamed module @0x534fc1f7) cannot access class sun.util.calendar.BaseCalendar$Date (in module java.base) because module java.base does not export sun.util.calendar to unnamed module @0x534fc1f7 at com.atlassian.jira.issue.customfields.manager.xml.AllowlistedXStreamFactory.fillJiraDefaults(AllowlistedXStreamFactory.java:77)
The root cause is from the incomplete fix from JRASERVER-76224 on which the <jira-install-dir>/bin/set-opens.sh script relies on JAVA_HOME to identify the current Java version.
It should use an existing solution from the check-java.sh script by checking the java_version environment variable.
Workaround
Choose one of the following workarounds:
- Set the JAVA_HOME variable before starting Jira.
- Modify the <jira-install-dir>/bin/set-opens.sh file to have the following contents.
#!/bin/sh if [ $java_version -ge 17 ]; then JVM_OPENS=$(cat $PRGDIR/java-opens.txt) JAVA_OPTS="$JVM_OPENS $JAVA_OPTS" fi
- is a regression of
-
JRASERVER-76224 Jira does not work when switching to Java 17 in a supported release
- Closed
- mentioned in
-
Page Loading...
- Wiki Page
-
Wiki Page Loading...