Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I install ActiveMQ as a 64-bit Service on windows?

How can I get around the following error? Is there a way I can copy a 64-bit wrapper out there?

FATAL  | wrapper  | 2011/01/07 08:53:48 | OpenSCManager failed - Access is denied. (0x5)
STATUS | wrapper  | 2011/01/07 08:54:13 | ActiveMQ installed.
STATUS | wrapper  | 2011/01/07 08:54:25 | --> Wrapper Started as Service
STATUS | wrapper  | 2011/01/07 08:54:26 | Launching a JVM...
INFO   | jvm 1    | 2011/01/07 08:54:26 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
INFO   | jvm 1    | 2011/01/07 08:54:26 |   Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.
INFO   | jvm 1    | 2011/01/07 08:54:26 | 
INFO   | jvm 1    | 2011/01/07 08:54:26 | 
INFO   | jvm 1    | 2011/01/07 08:54:26 | WARNING - Unable to load the Wrapper's native library 'wrapper.dll'.
INFO   | jvm 1    | 2011/01/07 08:54:26 |           The file is located on the path at the following location but
INFO   | jvm 1    | 2011/01/07 08:54:26 |           could not be loaded:
INFO   | jvm 1    | 2011/01/07 08:54:26 |             C:\stuff\apache-activemq-5.4.2\bin\win32\..\..\bin\win32\wrapper.dll
INFO   | jvm 1    | 2011/01/07 08:54:26 |           Please verify that the file is readable by the current user
INFO   | jvm 1    | 2011/01/07 08:54:26 |           and that the file has not been corrupted in any way.
INFO   | jvm 1    | 2011/01/07 08:54:26 |           One common cause of this problem is running a 32-bit version
INFO   | jvm 1    | 2011/01/07 08:54:26 |           of the Wrapper with a 64-bit version of Java, or vica versa.
INFO   | jvm 1    | 2011/01/07 08:54:26 |           This is a 64-bit JVM.
INFO   | jvm 1    | 2011/01/07 08:54:26 |           Reported cause:
INFO   | jvm 1    | 2011/01/07 08:54:26 |             C:\stuff\apache-activemq-5.4.2\bin\win32\wrapper.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform
INFO   | jvm 1    | 2011/01/07 08:54:26 |           System signals will not be handled correctly.
INFO   | jvm 1    | 2011/01/07 08:54:26 | 
like image 717
ScArcher2 Avatar asked Jan 07 '11 15:01

ScArcher2


1 Answers

I managed to install ActiveMQ successfully as a service on Windows 7 without having to download anything else. You just need to modify a few config settings.

If you go into the following folder: C:\apache-activemq-5.5.0\bin\win32

Open the "InstallService.bat" file in a local text editor.

Modify the bottom part of the script to look like the following. Notice that your JAVA_HOME environment variable needs to already be set and you'll need to pass it as a variable to the wrapper.

:conf
set _WRAPPER_CONF="%ACTIVEMQ_HOME%\bin\win32\wrapper.conf"

set _ACTIVEMQ_HOME="set.ACTIVEMQ_HOME=%ACTIVEMQ_HOME%"
set _ACTIVEMQ_BASE="set.ACTIVEMQ_BASE=%ACTIVEMQ_BASE%"
set _JAVA_HOME="set.JAVA_HOME=%JAVA_HOME%"

rem
rem Install the Wrapper as an NT service.
rem
:startup
"%ACTIVEMQ_HOME%\bin\win32\wrapper.exe" -i %_WRAPPER_CONF% %_ACTIVEMQ_HOME% %_ACTIVEMQ_BASE% %_JAVA_HOME%
if not errorlevel 1 goto :eof
pause

Then open up "C:\apache-activemq-5.5.0\bin\win32\wrapper.conf" in a local text editor

And change this:

# Java Application
wrapper.java.command=java

to this:

# Java Application
wrapper.java.command=%JAVA_HOME%\bin\java.exe

Once you've done that you should be able to run the InstallService.bat successfully.

Also, if you want to be able to use the UninstallService.bat file as well, open it up and hard code the path to the wrapper as well:

rem
rem Uninstall the Wrapper as an NT service.
rem
:startup
"%ACTIVEMQ_HOME%\bin\win32\wrapper.exe" -r %_WRAPPER_CONF%
if not errorlevel 1 goto :eof
pause

ActiveMQ 5.6.0 notes I just installed the latest 5.6.0 version of ActiveMQ and it actually contains a 64-bit wrapper in this version. If you try clicking on the InstallService.bat file it will still fail unfortunately giving you an error like this: InstallService.bat error.

If you open a windows command prompt as an administrator and run the InstallService.bat file from the command line it will work. Otherwise if you absolutely insist on being able to click the bat file it will work if you modify the bat files as above except remember to use win64 in this line instead of win32:

"%ACTIVEMQ_HOME%\bin\win64\wrapper.exe"
like image 54
2potatocakes Avatar answered Oct 07 '22 17:10

2potatocakes