Problems Installing JIRA applications as a service on Windows 64bit
症状
- The Windows Service fails to install.
The following error messages appear when running the service installation from the command line in tomcat 6:
[2007-11-02 15:21:37\] [402 prunsrv.c\] [error\] The operation completed successfully. [2007-11-02 15:21:37\] [1246 prunsrv.c\] [error\] Load configuration failed
And the following error message appear when running the service installation from the command line in tomcat 5.5.x:
[2011-05-20 03:12:26] [info] Starting service... [2011-05-20 03:12:27] [197 javajni.c] [error] %1 is not a valid Win32 application. [2011-05-20 03:12:27] [994 prunsrv.c] [error] Failed creating java C:\Program Files\Java\jdk1.6.0_25\jre\bin\server\jvm.dll [2011-05-20 03:12:27] [1269 prunsrv.c] [error] ServiceStart returned 1 [2011-05-20 03:12:31] [info] Run service finished. [2011-05-20 03:12:31] [info] Procrun finished.
Alternatively, the Windows Service installs successfully, but this error message appears even with the msvcr71.dll present in the <JIRA-install>/bin directory orthe C:\WINDOWS\system32 directory:
Windows could not start the Apache Tomcat JIRA application on Local Computer. For more information, review the System Event Log. If this is a non-Microsoft service, contact the service vendor, and refer to service-specific error code 0. In Event Viewer there was the error The Apache Tomcat JIRA applicationservice terminated with service-specific error 0 (0x0).
原因
While Tomcat will run on a 64-bit edition of Windows by running it directly through a 64-bit build of Java, the bundled Tomcat in versions of JIRA standalone 4.4.5 and below is only 32-bit.
回避策
- Replace your existing 32-bit Tomcat executable with a replacement 64-bit version downloaded from Tomcat's subversion repository:
- Determine the version of Tomcat that is bundled with your JIRA application distribution. From the cmd prompt, cd to the 'bin' subdirectory of your JIRA application installation;
次のコマンドを実行します。
catalina.bat version
- Go to http://tomcat.apache.org/
- In the left hand navigation under 'Download', look for the version of tomcat that is bundled with your application;
- Under 'Binary Distributions', look for "Core". Download the package '64-bit Windows zip';
- Open the zip file and navigate to the 'bin' subdirectory and locate the two files 'tomcat6.exe' and 'tomcat6w.exe';
- Copy these two files to the 'bin' subdirectory of your JIRA application installation to overwrite the two existing files;
Create a backup of the existing files first. - For each of the two files, go to properties and select 'Run this program as an administrator'
- Update the
PATH
environment variable. If you have downloaded the JDK, ensure you have both the <jdk_home>/bin and <jdk_home>/jre/bin directories in your systemPATH
environment variable. See Setting the JAVA_HOME Variable in Windows for instructions on how to set these.
Note that the JAVA_HOME variable and the PATH are different entities but are configured in the same place. The link above will give you directions on where to set these.
- Point your Windows Service to a JAVA 64-bit installation;
- Open the Windows Services via Command Line as in the instructions of this documentation (expand Windows Service section);
- Into the JAVA properties screen, click on the
Java
tab to see the list of current start-up options; - Edit the Java Virtual Machine to point to the jvm.dll file of a JAVA 64-bit installation:
ソリューション
Upgrade your JIRA application to the latest version, as 5.0 and onwards have 64-bit Windows installers, as per our Upgrading JIRA applications docs.