Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JIRA Will Not Start After Upgrade

Brad Huddleston October 16, 2018

We used to start JIRA using the start_service.bat file. After performing the upgrade via a file called 'atlassian-jira-software-7_12_1-x64' we now get this error:

         c:\Program Files\Atlassian\JIRA>start_service
         The service name is invalid.

         More help is available by typing NET HELPMSG 2185.

This is the content of the start_service.bat file:

         @echo off
         if "%OS%" == "Windows_NT" setlocal
         rem ---------------------------------------------------------------------------
         rem Start script for the JIRA Service
         rem

         net start JIRASoftware111018102937


Any help will be greatly appreciated.

2 answers

0 votes
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 16, 2018

The fact that we see your system was trying to use that  --JvmOptions9 option is an indication that the system has a Java 9 or later version installed and Jira is trying to use that JVM to load itself.   In the present versions of Jira (7.12.x), Jira does not support Java 9 or later yet.  See Jira Supported platforms 7.12.x for more details.

 

I would recommend that you try to run a command such as

echo $JAVA_HOME

via the command prompt in order to see if that variable is set on the system.  If it is, then it will echo a path such as c:\java\version\   If it is not set you won't see any path when using that command. 

I would recommend that you install Oracle Java 8 separately from Jira per the instructions in Installing Java.  Also be sure to set the JAVA_HOME variable and restart the OS.  Then see if you start up Jira.

You can have multiple versions of java installed on the operating system, but we need to make sure that Jira is using a supported JVM to work correctly.

Brad Huddleston October 17, 2018

Is there a difference between 'echo %JAVA_HOME' and 'echo %JAVA_HOME%'? The first command just returns '%JAVA_HOME' while the second returns 'C:\Progra~1\Java\jdk1.8.0_181', which is the path I set via the System Variable.

According to the Control Panel, the computer just has Java 8 installed. I don't know where else to check if a different version of JAVA is installed. There is 'Java 8 Update 181', 'Java 8 Update 181 (64-bit)' and 'Java SE Development Kit 8 Update 181 (64-bit)'. All three have a version number of 8.0.1810.13. Could there be an issue with the non-64-bit and 64 bit versions?

Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 18, 2018

For Windows echo %JAVA_HOME% is the correct command.   Sorry, I was thinking of the linux/unix echo command.

If you have a 32 bit version of Java installed to this machine, I would actually recommend uninstalling that version.  The 64 bit version of Jira won't be able to use that Java version and in turn it could cause problems if Jira is trying to load with that JVM.

After you do that, try to restart the system, and then go back to see if you can run the service.bat install JIRA from a command prompt where you right click on the command prompt and choose 'Run as administrator'.  This can help to bypass some UAC windows controls that could prevent this bat file from running as expected in Windows system that have UAC enabled.

Brad Huddleston October 19, 2018

Got the service installed. Can't get it started. When I run 'start_service.bat' I get:

 

The Atlassian JIRA service is starting.
The Atlassian JIRA service could not be started.

A service specific error occurred: 1.

More help is available by typing NET HELPMSG 3547.

 

In the log file I get:

 

 Running 'JIRASoftware111018102937' Service...
[2018-10-19 07:24:50] [info]  [ 5976] Starting service...
[2018-10-19 07:24:50] [error] [ 5976] Failed creating java C:\Progra~1\Java\jre8\bin\server\jvm.dll
[2018-10-19 07:24:50] [error] [ 5976] The system cannot find the path specified.
[2018-10-19 07:24:50] [error] [ 5976] ServiceStart returned 1

 

I can't find where that path (C:\Progra~1\Java\jre8\bin\server\jvm.dll) is being set. Java Home and JRE Home are both set to different locations that one.

Brad Huddleston October 19, 2018

Just followed the instructions here:

 

https://confluence.atlassian.com/jirakb/jira-service-fails-to-start-in-windows-is-not-a-valid-win32-application-313463797.html

 

removed and re-installed the service. Seems to have done something. I'm now getting a 'Jira had problems starting up' page so I'm going to work that for a bit.

Brad Huddleston October 25, 2018

Now I'm getting memory errors on start up. Since it seems like a separate issue, I opened another question:

 

Memory-Allocation-Pool

 

thanks for all the help.

0 votes
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 16, 2018

Hello,

Have a look at the Services, if the JIRASoftware111018102937 service exists.

Brad Huddleston October 16, 2018

Sorry, gotta dumb it down some. How do I do that?

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 16, 2018

Start menu and type Services

Brad Huddleston October 16, 2018

Okay, no services with 'Jira' or 'Atlassian' or anything else I can find that would be related. Found this article:

https://confluence.atlassian.com/adminjiraserver073/running-jira-applications-as-a-windows-service-861254037.html

 

Which instructed me to try this:

service.bat install JIRA

After configuring my Java Environmental Variable I get this:

c:\Program Files\Atlassian\JIRA\bin>service.bat install JIRA
Installing the service 'JIRASoftware111018102937' ...
Using CATALINA_HOME:    "C:\Program Files\Atlassian\JIRA"
Using CATALINA_BASE:    "C:\Program Files\Atlassian\JIRA"
Ignoring JAVA_HOME:        "C:\Progra~1\Java\jdk1.8.0_181"
Using JRE_HOME:         "C:\Progra~1\Java\jre8"
Using JVM:              "C:\Progra~1\Java\jre8\bin\server\jvm.dll"
[2018-10-16 09:55:11] [error] [ 4996] Unrecognized program option --JvmOptions9
[2018-10-16 09:55:11] [error] [ 4996] Invalid command line arguments
[2018-10-16 09:55:11] [error] [ 4996] Commons Daemon procrun failed with exit value: 1 (Failed to parse command line arguments)
Failed installing 'JIRASoftware111018102937' service

 

Progress, I think, but I'm not sure what to try next.

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 16, 2018

Search for --JvmOptions9 stirng in a file in the JIRA_INSTALLATION/bin folder and remove this option.

Brad Huddleston October 16, 2018

Found the string '--JvmOptions9' in the service.bat file, removed it. Got this error:

 

'--Startup' is not recognized as an internal or external command, operable program or batch file.

 

Then I removed that option:

 

--Startup "%SERVICE_STARTUP_MODE%" ^

 

Got the same error on the next line:

--JvmMs "%JvmMs%" ^

Removed, same error on next line:

--JvmMx "%JvmMx%"

Removed, then "Failed installing 'JIRASoftware111018102937' service" with no more details.

 

The 'Option' above all those, '--JvmOptions', looks pretty convoluted to me and would be a good place for a typo:

 

--JvmOptions "-Djava.awt.headless=true;-Datlassian.standalone=JIRA;-Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true;-Dmail.mime.decodeparameters=true;-Dorg.dom4j.factory=com.atlassian.core.xml.InterningDocumentFactory;-XX:-OmitStackTraceInFastThrow;-XX:+PrintGCDetails;-XX:+PrintGCDateStamps;-XX:+PrintGCTimeStamps;-XX:+PrintGCCause;-XX:+UseGCLogFileRotation;-XX:NumberOfGCLogFiles=5;-XX:GCLogFileSize=20M;-Xloggc:%CATALINA_HOME%\logs\atlassian-jira-gc-%%t.log;-Dcatalina.home=%CATALINA_HOME%;-Dcatalina.base=%CATALINA_BASE%;-D%ENDORSED_PROP%=%CATALINA_HOME%\endorsed;-Djava.io.tmpdir=%CATALINA_BASE%\temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=%CATALINA_BASE%\conf\logging.properties;%JvmArgs%" ^

 

Thanks a ton for all your help so far.

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 16, 2018

Could show the service.bat file?

Brad Huddleston October 16, 2018

@echo off
rem Licensed to the Apache Software Foundation (ASF) under one or more
rem contributor license agreements.  See the NOTICE file distributed with
rem this work for additional information regarding copyright ownership.
rem The ASF licenses this file to You under the Apache License, Version 2.0
rem (the "License"); you may not use this file except in compliance with
rem the License.  You may obtain a copy of the License at
rem
rem     http://www.apache.org/licenses/LICENSE-2.0
rem
rem Unless required by applicable law or agreed to in writing, software
rem distributed under the License is distributed on an "AS IS" BASIS,
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem See the License for the specific language governing permissions and
rem limitations under the License.

rem ---------------------------------------------------------------------------
rem NT Service Install/Uninstall script
rem
rem Options
rem install                Install the service using Tomcat8 as service name.
rem                        Service is installed using default settings.
rem remove                 Remove the service from the System.
rem
rem name        (optional) If the second argument is present it is considered
rem                        to be new service name
rem ---------------------------------------------------------------------------

setlocal

set "SELF=%~dp0%service.bat"
set "BIN_DIR=%~dp0"
                                                set CATALINA_HOME=C:\Program Files\Atlassian\JIRA
set "CURRENT_DIR=%cd%"
if not "%CATALINA_HOME%" == "" goto gotHome
set "CATALINA_HOME=%cd%"
if exist "%CATALINA_HOME%\bin\tomcat8.exe" goto okHome
rem CD to the upper dir
cd ..
set "CATALINA_HOME=%cd%"
:gotHome
if exist "%CATALINA_HOME%\bin\tomcat8.exe" goto okHome
echo The tomcat8.exe was not found...
echo The CATALINA_HOME environment variable is not defined correctly.
echo This environment variable is needed to run this program
goto end
:okHome
rem Make sure prerequisite environment variables are set
rem if not "%JAVA_HOME%" == "" goto gotJdkHome
if not "%JRE_HOME%" == "" goto gotJreHome
echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
echo Service will use the bundled JRE.
                                                echo Failing that, service will try to guess them from the registry.
                                                set "JRE_HOME=%BIN_DIR%\..\jre"
goto okJavaHome
:gotJreHome
if not exist "%JRE_HOME%\bin\java.exe" goto noJavaHome
if not exist "%JRE_HOME%\bin\javaw.exe" goto noJavaHome
goto okJavaHome
:gotJdkHome
if not exist "%JAVA_HOME%\bin\javac.exe" goto noJavaHome
rem Java 9 has a different directory structure
if exist "%JAVA_HOME%\jre\bin\java.exe" goto preJava9Layout
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
if not exist "%JAVA_HOME%\bin\javaw.exe" goto noJavaHome
if not "%JRE_HOME%" == "" goto okJavaHome
set "JRE_HOME=%JAVA_HOME%"
goto okJavaHome
:preJava9Layout
if not exist "%JAVA_HOME%\jre\bin\javaw.exe" goto noJavaHome
if not "%JRE_HOME%" == "" goto okJavaHome
set "JRE_HOME=%JAVA_HOME%\jre"
goto okJavaHome
:noJavaHome
echo The JAVA_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
echo NB: JAVA_HOME should point to a JDK not a JRE
goto end
:okJavaHome
if not "%CATALINA_BASE%" == "" goto gotBase
set "CATALINA_BASE=%CATALINA_HOME%"
:gotBase

set "EXECUTABLE=%CATALINA_HOME%\bin\tomcat8.exe.x64"

rem Set default Service name
set SERVICE_NAME=JIRASoftware111018102937
set DISPLAYNAME=Atlassian JIRA

rem Java 9 no longer supports the java.endorsed.dirs
rem system property. Only try to use it if
rem JAVA_ENDORSED_DIRS was explicitly set
rem or CATALINA_HOME/endorsed exists.
set ENDORSED_PROP=ignore.endorsed.dirs
if "%JAVA_ENDORSED_DIRS%" == "" goto noEndorsedVar
set ENDORSED_PROP=java.endorsed.dirs
goto doneEndorsed
:noEndorsedVar
if not exist "%CATALINA_HOME%\endorsed" goto doneEndorsed
set ENDORSED_PROP=java.endorsed.dirs
:doneEndorsed

if "x%1x" == "xx" goto displayUsage
set SERVICE_CMD=%1
shift
if "x%1x" == "xx" goto checkServiceCmd
:checkUser
if "x%1x" == "x/userx" goto runAsUser
if "x%1x" == "x--userx" goto runAsUser
set SERVICE_NAME=JIRASoftware111018102937
set DISPLAYNAME=Atlassian JIRA
shift
if "x%1x" == "xx" goto checkServiceCmd
goto checkUser
:runAsUser
shift
if "x%1x" == "xx" goto displayUsage
set SERVICE_USER=%1
shift
runas /env /savecred /user:%SERVICE_USER% "%COMSPEC% /K \"%SELF%\" %SERVICE_CMD% %SERVICE_NAME%"
goto end
:checkServiceCmd
if /i %SERVICE_CMD% == install goto doInstall
if /i %SERVICE_CMD% == remove goto doRemove
if /i %SERVICE_CMD% == uninstall goto doRemove
echo Unknown parameter "%SERVICE_CMD%"
:displayUsage
echo.
echo Usage: service.bat install/remove [service_name] [/user username]
goto end

:doRemove
rem Remove the service
echo Removing the service '%SERVICE_NAME%' ...
echo Using CATALINA_BASE:    "%CATALINA_BASE%"

"%EXECUTABLE%" //DS//%SERVICE_NAME% ^
    --LogPath "%CATALINA_BASE%\logs"
if not errorlevel 1 goto removed
echo Failed removing '%SERVICE_NAME%' service
goto end
:removed
echo The service '%SERVICE_NAME%' has been removed
goto end

:doInstall
rem Install the service
echo Installing the service '%SERVICE_NAME%' ...
echo Using CATALINA_HOME:    "%CATALINA_HOME%"
echo Using CATALINA_BASE:    "%CATALINA_BASE%"
echo Ignoring JAVA_HOME:        "%JAVA_HOME%"
echo Using JRE_HOME:         "%JRE_HOME%"

rem Try to use the server jvm
set "JVM=%JRE_HOME%\bin\server\jvm.dll"
if exist "%JVM%" goto foundJvm
rem Try to use the client jvm
set "JVM=%JRE_HOME%\bin\client\jvm.dll"
if exist "%JVM%" goto foundJvm
echo Warning: Neither 'server' nor 'client' jvm.dll was found at JRE_HOME.
set JVM=auto
:foundJvm
echo Using JVM:              "%JVM%"

set "CLASSPATH=%CATALINA_HOME%\bin\bootstrap.jar;%CATALINA_BASE%\bin\tomcat-juli.jar"
if not "%CATALINA_HOME%" == "%CATALINA_BASE%" set "CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\bin\tomcat-juli.jar"

if "%SERVICE_STARTUP_MODE%" == "" set SERVICE_STARTUP_MODE=auto
if "%JvmMs%" == "" set JvmMs=256
if "%JvmMx%" == "" set JvmMx=768

"%EXECUTABLE%" //IS//%SERVICE_NAME% ^
    --Description "Atlassian JIRA 7.12.1" ^
    --DisplayName "%DISPLAYNAME%" ^
    --Install "%EXECUTABLE%" ^
    --LogPath "%CATALINA_BASE%\logs" ^
    --StdOutput auto ^
    --StdError auto ^
    --Classpath "%CLASSPATH%" ^
    --Jvm "%JVM%" ^
    --StartMode jvm ^
    --StopMode jvm ^
    --StartPath "%CATALINA_HOME%" ^
    --StopPath "%CATALINA_HOME%" ^
    --StartClass org.apache.catalina.startup.Bootstrap ^
    --StopClass org.apache.catalina.startup.Bootstrap ^
    --StartParams start ^
    --StopParams stop ^
    --JvmOptions "-Djava.awt.headless=true;-Datlassian.standalone=JIRA;-Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true;-Dmail.mime.decodeparameters=true;-Dorg.dom4j.factory=com.atlassian.core.xml.InterningDocumentFactory;-XX:-OmitStackTraceInFastThrow;-XX:+PrintGCDetails;-XX:+PrintGCDateStamps;-XX:+PrintGCTimeStamps;-XX:+PrintGCCause;-XX:+UseGCLogFileRotation;-XX:NumberOfGCLogFiles=5;-XX:GCLogFileSize=20M;-Xloggc:%CATALINA_HOME%\logs\atlassian-jira-gc-%%t.log;-Dcatalina.home=%CATALINA_HOME%;-Dcatalina.base=%CATALINA_BASE%;-D%ENDORSED_PROP%=%CATALINA_HOME%\endorsed;-Djava.io.tmpdir=%CATALINA_BASE%\temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=%CATALINA_BASE%\conf\logging.properties;%JvmArgs%" ^
    --JvmOptions9 "--add-opens=java.base/java.lang=ALL-UNNAMED#--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED" ^
    --Startup "%SERVICE_STARTUP_MODE%" ^
    --JvmMs "%JvmMs%" ^
    --JvmMx "%JvmMx%"
if not errorlevel 1 goto installed
echo Failed installing '%SERVICE_NAME%' service
goto end
:installed
echo The service '%SERVICE_NAME%' has been installed.

:end
cd "%CURRENT_DIR%"

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events