After upgrading confluence from 7.0 to 7.4 Service fails to start
Asked by gaurav.trivedi:

Hello Friends,

Recently we have upgraded confluence from 7.0 to 7.4, After the upgrade we are getting below error in confluence while starting the service. if someone can help providing guidance on this.

7.0 was working fine, problem started only after 7.4

\[2020-06-10 04:21:15\] \[info\] \[ 3136\] Starting service...  
\[2020-06-10 04:21:15\] \[error\] \[ 3268\] CreateJavaVM Failed with error \[-6\]  
\[2020-06-10 04:21:15\] \[error\] \[ 3268\] The system could not find the environment option that was entered.  
\[2020-06-10 04:21:15\] \[error\] \[ 3136\] Failed to start Java  
\[2020-06-10 04:21:15\] \[error\] \[ 3136\] ServiceStart returned 4.  
\[2020-06-10 04:21:15\] \[info\] \[ 2644\] Run service finished.  
\[2020-06-10 04:21:15\] \[info\] \[ 2644\] Apache Commons Daemon procrun finished.


Answers:
author: Nic Brough -Adaptavist-
body: This is not strictly a Confluence error.

My best guess is that your server is now using a version of Java that does not accept parameters that Confluence is trying to start with.

Three simple commands to check this (I've assumed a Unix like system)

* grep -H E "JAVA\|JVM" \<your confluence installation\>/bin/\*
* java -version
* which java

The first one means "find what JAVA and JVM settings you are starting Confluence with", which should tell us what Java Confluence is trying to run. The second one should tell us what the system default java is, and the third which actual java executable the system is going for.

comments: author: gaurav.trivedi
body: Thank you Nic_Brough_Adaptavist_ for your feedback

We are currently using it on Windows machine here are the information retrieved based on commands.

Java -version

java version "1.8.0_144"  
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)  
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

for %i in (java.exe) do @\[deleted\]. %\~$PATH:i

C:\\ProgramData\\Oracle\\Java\\javapath\\java.exe

Grep equivalnt as findStr in Windows

catalina.bat:rem Include here and not in JAVA_OPTS all options, that should  
catalina.bat:rem the JVM should use (java.io.tmpdir). Defaults to  
catalina.bat:rem JAVA_HOME Must point at your Java Development Kit installation.  
catalina.bat:rem Defaults to JAVA_HOME if empty. If JRE_HOME and JAVA_HOME  
catalina.bat:rem JAVA_OPTS (Optional) Java runtime options used when any command  
catalina.bat:rem JAVA_ENDORSED_DIRS (Optional) Lists of of semi-colon separated directories  
catalina.bat:rem command is executed. Specifies whether JVM should suspend  
catalina.bat:set "JAVA_OPTS=%JAVA_OPTS% %JSSE_OPTS%"  
catalina.bat:set "JAVA_OPTS=%JAVA_OPTS% -Djava.protocol.handler.pkgs=org.apache.catalina.webresources"  
catalina.bat:rem Configure JAVA 9 specific start-up parameters  
catalina.bat:set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-opens=java.base/java.lang=ALL-UNNAMED"  
catalina.bat:set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-opens=java.base/java.io=ALL-UNNAMED"  
catalina.bat:set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED"  
catalina.bat:rem JAVA_ENDORSED_DIRS was explicitly set  
catalina.bat:if "%JAVA_ENDORSED_DIRS%" == "" goto noEndorsedVar  
catalina.bat:echo Using JAVA_HOME: "%JAVA_HOME%"  
catalina.bat:set _EXECJAVA=%_RUNJAVA%  
catalina.bat:set _EXECJAVA=%_RUNJDB%  
catalina.bat:set _EXECJAVA=start "%TITLE%" %_RUNJAVA%  
catalina.bat:%_EXECJAVA% -classpath "%CATALINA_HOME%\\lib\\catalina.jar" org.apache.catalina.util.ServerInfo  
catalina.bat:%_EXECJAVA% %LOGGING_CONFIG% %LOGGING_MANAGER% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -D%ENDORSED_PROP%="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%  
catalina.bat:%_EXECJAVA% %LOGGING_CONFIG% %LOGGING_MANAGER% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -D%ENDORSED_PROP%="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Djava.security.manager -Djava.security.policy=="%SECURITY_POLICY_FILE%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%  
catalina.bat:%_EXECJAVA% %LOGGING_CONFIG% %LOGGING_MANAGER% %JAVA_OPTS% %JPDA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -D%ENDORSED_PROP%="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%  
catalina.bat:%_EXECJAVA% %LOGGING_CONFIG% %LOGGING_MANAGER% %JAVA_OPTS% %JPDA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -D%ENDORSED_PROP%="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Djava.security.manager -Djava.security.policy=="%SECURITY_POLICY_FILE%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%  
service.bat:if not "%JAVA_HOME%" == "" goto gotJdkHome  
service.bat:echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined  
service.bat:if not exist "%JAVA_HOME%\\bin\\javac.exe" goto noJavaHome  
service.bat:if exist "%JAVA_HOME%\\jre\\bin\\java.exe" goto preJava9Layout  
service.bat:if not exist "%JAVA_HOME%\\bin\\java.exe" goto noJavaHome  
service.bat:set "JRE_HOME=%JAVA_HOME%"  
service.bat:set "JRE_HOME=%JAVA_HOME%\\jre"  
service.bat:echo The JAVA_HOME environment variable is not defined correctly  
service.bat:echo NB: JAVA_HOME should point to a JDK not a JRE  
service.bat:rem JAVA_ENDORSED_DIRS was explicitly set  
service.bat:if "%JAVA_ENDORSED_DIRS%" == "" goto noEndorsedVar  
service.bat:echo Ignoring JAVA_HOME: "%JAVA_HOME%"  
service.bat:set "JVM=C:\\Program Files\\Atlassian\\Confluence\\jre\\bin\\server\\jvm.dll"  
service.bat:if exist "%JVM%" goto foundJvm  
service.bat:set "JVM=%JRE_HOME%\\bin\\client\\jvm.dll"  
service.bat:if exist "%JVM%" goto foundJvm  
service.bat:set JVM=auto  
service.bat:echo Using JVM: "%JVM%"  
service.bat: --Jvm "%JVM%" \^  
setclasspath.bat:rem Set JAVA_HOME or JRE_HOME if not already set, ensure any provided settings  
setclasspath.bat:rem In debug mode we need a real JDK (JAVA_HOME)  
setclasspath.bat:if not "%JAVA_HOME%" == "" goto gotJavaHome  
setclasspath.bat:echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined  
setclasspath.bat:if "%JAVA_HOME%" == "" goto noJavaHome  
setclasspath.bat:if not exist "%JAVA_HOME%\\bin\\java.exe" goto noJavaHome  
setclasspath.bat:if not exist "%JAVA_HOME%\\bin\\jdb.exe" goto noJavaHome  
setclasspath.bat:if not exist "%JAVA_HOME%\\bin\\javac.exe" goto noJavaHome  
setclasspath.bat:set "JRE_HOME=%JAVA_HOME%"  
setclasspath.bat:echo The JAVA_HOME environment variable is not defined correctly.  
setclasspath.bat:echo NB: JAVA_HOME should point to a JDK not a JRE.  
setclasspath.bat:rem No JRE given, use JAVA_HOME as JRE_HOME  
setclasspath.bat:set "JRE_HOME=%JAVA_HOME%"  
setclasspath.bat:if not "%JAVA_ENDORSED_DIRS%" == "" goto gotEndorseddir  
setclasspath.bat:set "JAVA_ENDORSED_DIRS=%CATALINA_HOME%\\endorsed"  
setclasspath.bat:rem Don't override _RUNJAVA if the user has set it previously  
setclasspath.bat:if not "%_RUNJAVA%" == "" goto gotRunJava  
setclasspath.bat:set _RUNJAVA="%JRE_HOME%\\bin\\java.exe"  
setclasspath.bat:rem Also note the quoting as JAVA_HOME may contain spaces.  
setclasspath.bat:set _RUNJDB="%JAVA_HOME%\\bin\\jdb.exe"  
setenv.bat:rem IMPORTANT NOTE: Only set JAVA_HOME or JRE_HOME above this line  
setenv.bat:rem Set the JVM arguments used to start Confluence.  
setenv.bat:set CATALINA_OPTS=%START_CONFLUENCE_JAVA_OPTS% %CATALINA_OPTS%  
setjre.bat:rem Set JAVA_HOME or JRE_HOME if not already set.  
setjre.bat:rem In debug mode we need a real JDK (JAVA_HOME)  
setjre.bat:if not "%JAVA_HOME%" == "" goto gotJavaHome  
setjre.bat:echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined  
setjre.bat:if "%JAVA_HOME%" == "" goto noJavaHome  
setjre.bat:if not exist "%JAVA_HOME%\\bin\\java.exe" goto noJavaHome  
setjre.bat:if not exist "%JAVA_HOME%\\bin\\javaw.exe" goto noJavaHome  
setjre.bat:if not exist "%JAVA_HOME%\\bin\\jdb.exe" goto noJavaHome  
setjre.bat:if not exist "%JAVA_HOME%\\bin\\javac.exe" goto noJavaHome  
setjre.bat:set "JRE_HOME=%JAVA_HOME%"  
setjre.bat:echo The JAVA_HOME environment variable is not defined correctly.  
setjre.bat:echo NB: JAVA_HOME should point to a JDK not a JRE.  
setjre.bat:rem No JRE given, use JAVA_HOME as JRE_HOME  
setjre.bat:set "JRE_HOME=%JAVA_HOME%"  
start-confluence.bat:set START_CONFLUENCE_JAVA_OPTS=-Datlassian.plugins.startup.options="%\*%"  
tool-wrapper.bat:rem JAVA_HOME Must point at your Java Development Kit installation.  
tool-wrapper.bat:rem Defaults to JAVA_HOME if empty. If JRE_HOME and JAVA_HOME  
tool-wrapper.bat:rem JAVA_OPTS (Optional) Java runtime options.  
tool-wrapper.bat:rem JAVA_ENDORSED_DIRS (Optional) Lists of of semi-colon separated directories  
tool-wrapper.bat:set JAVA_OPTS=%JAVA_OPTS% -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager  
tool-wrapper.bat:rem JAVA_ENDORSED_DIRS was explicitly set  
tool-wrapper.bat:if "%JAVA_ENDORSED_DIRS%" == "" goto noEndorsedVar  
tool-wrapper.bat:%_RUNJAVA% %JAVA_OPTS% %TOOL_OPTS% -D%ENDORSED_PROP%="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.home="%CATALINA_HOME%" org.apache.catalina.startup.Tool %CMD_LINE_ARGS%


author: Nic Brough -Adaptavist-
body: That looks like it means Confluence is using the system Java install, and that version is fine.

But the error message is telling us that it is getting invalid parameters. Confluence is not setting anything wrong according to the results of your search.

Have a look through <https://confluence.atlassian.com/confkb/tomcat-fails-to-start-313463519.html> to start with, but after that I'm afraid I know a lot less about JVM parameter failures than a search engine.


author: gaurav.trivedi
body: Thank you Nic_Brough_Adaptavist_ for your feedback

We have changed the JVM on the server that made it work. Instead of using existing JVM on the server, we have pointed to JVM came along with server to solve the issue.


author: psabdulkader
body: for me it works after installing new JAVA 8 and pointing JVM to new installation.


Tags: confluence-server

server