We were using Tanuki java service wrapper to run ActiveMQ previously. After migrating to a 64-bit server running Windows Server 2008 R2, we're not able to install ActiveMQ as a service unless we pay for the Standard or Professional version of java service wrapper.
I read that others were using Apache Commons Daemon as a service wrapper for ActiveMQ on 64-bit architectures http://blog.bigrocksoftware.com/2010/10/07/commons-daemon-procrun-as-a-java-service-wrapper-for-activemq/ . The instructions on this site allowed me to successfully install ActiveMQ as a service on our server, but we received errors in our Event Log when starting the service. I commented on this post at the bottom of the page
I was able to install ActiveMQ as a service using the instructions in this article, however when I start it up via the Service control panel I get Windows could not start the ActiveMQ on the local computer. For more information, review the System Event Log. When I check the Event Log I see The ActiveMQ service terminated with service-specific error The operation completed successfully.. I think this may be related to my architecture. I’m running Windows server 2008 R2, my processers are 64 bit Intel Xeon. I did not see that architecture included in the commons-daemon package. When I installed, I used the generic ‘prunsrv.exe’ file instead of the amd64/prunsrv.exe, or the ia64/prunsrv.exe – I received errors when I tried to use these exe files during installation, and was only able to install using the generic prunsrv.exe. Is there a way to get this to work with my architecture? or did I miss anything?
I was wondering if anyone had any suggestions for me on this list? Perhaps something I missed when installing via procrun, or another service wrapper that works on 64-bit Windows. Any comments are appreciated.
Thanks.
Edit 011312:
Thanks for your response. The activemq-daemon logs list these errors
[2012-01-11 09:45:43] [error] %1 is not a valid Win32 application.
[2012-01-11 09:45:43] [error] ServiceStart returned 1
[2012-01-11 09:45:43] [error] %1 is not a valid Win32 application.
[2012-01-11 09:45:43] [info] Run service finished.
[2012-01-11 09:45:43] [info] Commons Daemon procrun finished
[2012-01-11 09:46:05] [info] Commons Daemon procrun (1.0.8.0 32-bit) started
[2012-01-11 09:46:05] [info] Running 'ActiveMQ' Service...
[2012-01-11 09:46:05] [info] Starting service...
[2012-01-11 09:46:05] [error] %1 is not a valid Win32 application.
[2012-01-11 09:46:05] [error] Failed creating java C:\Program Files\Java\jdk1.6.0_29\jre\bin\server\jvm.dll
I interpret these errors to mean that maybe one of the options with which I installed activemq via procrun as a service is incorrect - I did verify that the jvm.dll does exist at that location in my file system. I installed procrun with these options, using the options listed in the blog post as a model
ActiveMQ.exe //IS//ActiveMQ --DisplayName=" ActiveMQ" --Description=" ActiveMQ Java Messaging Server" --Startup=auto --LogPath=D:\apache-activemq-5.5.0-bin\apache-activemq-5.5.0-bin\apache-activemq-5.5.0\data --LogLevel=INFO --LogPrefix=activemq-daemon --StdOutput=auto --StdError=auto --StartPath=D:\apache-activemq-5.5.0-bin\apache-activemq-5.5.0-bin\apache-activemq-5.5.0 --StartClass=org.apache.activemq.console.Main --StartMethod=main --StartParams=start --StartMode=jvm --StopPath=D:\apache-activemq-5.5.0-bin\apache-activemq-5.5.0-bin\apache-activemq-5.5.0 --StopClass=org.apache.activemq.console.Main --StopMethod=main --StopParams=shutdown --StopMode=jvm --Jvm=C:\Program Files\Java\jdk1.6.0_29\jre\bin\server\jvm.dll --Classpath=D:\apache-activemq-5.5.0-bin\apache-activemq-5.5.0-bin\apache-activemq-5.5.0\bin\run.jar --JvmOptions=-Xmx512M ++JvmOptions=-Dorg.apache.activemq.UseDedicatedTaskRunner=true ++JvmOptions=-Djava.util.logging.config.file=logging.properties++JvmOptions=-Dactivemq.home=D:\apache-activemq-5.5.0-bin\apache-activemq-5.5.0-bin\apache-activemq-5.5.0 ++JvmOptions=-Dactivemq.base=C:\Java\apache-activemq-5.4.1 ++JvmOptions=-Dactivemq.classpath=D:\apache-activemq-5.5.0-bin\apache-activemq-5.5.0-bin\apache-activemq-5.5.0\conf ++JvmOptions=-Dcom.sun.management.jmxremote.port=9004 ++JvmOptions=-Dcom.sun.management.jmxremote.authenticate=false ++JvmOptions=-Dcom.sun.management.jmxremote.ssl=false