Error: Unable to access jarfile confluence-context-path-extractor.jar
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
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
Problem
On startup, after executing ./start-confluence.sh the following appears in the shell output:
Using Java: /opt/openjdk/jdk8u202-b08/bin/java
Error: Unable to access jarfile /opt/atlassian/confluence/bin/confluence-context-path-extractor.jar/opt/atlassian/confluence
Diagnosis
Environment
Confluence Server or Data Center
The commands in the above error come from the <confluence-install>/bin/setenv.sh file. Note in the above error that the path is repeated after the .jar file:
/opt/atlassian/confluence/bin/confluence-context-path-extractor.jar/opt/atlassian/confluence
Cause
The relevant section in the setenv.sh file is missing a space between "confluence-context-path-extractor.jar" and "$CATALINA_HOME" as seen below:
echo "---------------------------------------------------------------------------"
echo "Using Java: $JRE_HOME/bin/java"
CONFLUENCE_CONTEXT_PATH=`$JRE_HOME/bin/java -jar $CATALINA_HOME/bin/confluence-context-path-extractor.jar$CATALINA_HOME`
export CONFLUENCE_CONTEXT_PATH
$JRE_HOME/bin/java -jar $CATALINA_HOME/bin/synchrony-proxy-watchdog.jar $CATALINA_HOME
echo "---------------------------------------------------------------------------"
Resolution
Change this line in setenv.sh:
CONFLUENCE_CONTEXT_PATH=`$JRE_HOME/bin/java -jar $CATALINA_HOME/bin/confluence-context-path-extractor.jar$CATALINA_HOME`
To look like this example which includes a space between the .jar and the $ sign:
CONFLUENCE_CONTEXT_PATH=`$JRE_HOME/bin/java -jar $CATALINA_HOME/bin/confluence-context-path-extractor.jar $CATALINA_HOME`
Then, restart Confluence for the changes to take effect.