我们之前使用 Tanuki java 服务包装器来运行 ActiveMQ。迁移到运行 Windows Server 2008 R2 的 64 位服务器后,我们无法将 ActiveMQ 安装为服务,除非我们为标准版或专业版的 java 服务包装器付费。
我读到其他人在 64 位架构上使用 Apache Commons Daemon 作为 ActiveMQ 的服务包装器http://blog.bigrocksoftware.com/2010/10/07/commons-daemon-procrun-as-a-java-service-包装器-for-activemq/。该站点上的说明允许我成功地将 ActiveMQ 作为服务安装在我们的服务器上,但是在启动服务时我们在事件日志中收到错误。我在页面底部评论了这篇文章
我能够使用本文中的说明将 ActiveMQ 安装为服务,但是当我通过服务控制面板启动它时,我得到 Windows 无法在本地计算机上启动 ActiveMQ。有关详细信息,请查看系统事件日志。当我检查事件日志时,我看到 ActiveMQ 服务因服务特定错误而终止操作成功完成。我认为这可能与我的架构有关。我正在运行 Windows server 2008 R2,我的处理器是 64 位 Intel Xeon。我没有看到 commons-daemon 包中包含该架构。当我安装时,我使用了通用的“prunsrv.exe”文件,而不是 amd64/prunsrv.exe 或 ia64/prunsrv.exe——我在安装过程中尝试使用这些 exe 文件时收到错误,并且只能使用通用 prunsrv.exe 安装。有没有办法让它与我的架构一起使用?还是我错过了什么?
我想知道是否有人在此列表中对我有任何建议?也许我在通过 procrun 安装时错过了一些东西,或者其他适用于 64 位 Windows 的服务包装器。任何意见表示赞赏。
谢谢。
编辑 011312:
感谢您的答复。activemq-daemon 日志列出了这些错误
[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
我将这些错误解释为可能是我通过 procrun 作为服务安装 activemq 的选项之一不正确 - 我确实验证了 jvm.dll 确实存在于我的文件系统中的该位置。我使用博客文章中列出的选项作为模型安装了带有这些选项的 procrun
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\运行。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=false0 ++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=false0 ++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