ActiveMQ Artemis 2.27.1 Windows服务含空格路径无法正常停止
ActiveMQ Artemis 2.27.1 Windows服务含空格路径无法正常停止问题
问题现象
当ActiveMQ Artemis 2.27.1作为Windows服务安装,且实例路径包含空格时,服务启动正常,但无法正常停止:
- 可通过
artemis-service.exe start成功安装并启动服务(示例路径:C:\executables\my artemis\apache-artemis\bin\test_space_broker\bin) - 执行
artemis-service.exe stop或通过service.msc操作停止时,服务会卡在“停止中”状态直至超时,触发报错:
Windows could not stop the ActiveMQ Artemis: test_space_broker @ 00.00 service on Local Computer. Error 1053: The service did not respond to the start or control request in a timely fashion.
排查线索
服务日志中未捕获到相关异常,推测问题与服务配置XML文件的路径解析逻辑有关。检查配置XML发现环境变量存在编码异常:
<env name="ARTEMIS_INSTANCE_URI" value="file:/C:/executables/my%20artemis/apache-artemis/bin/test_space_broker/"/> <env name="ARTEMIS_INSTANCE_ETC_URI" value="file:/C:/executables/my%%20artemis/apache-artemis/bin/test_space_broker/etc/"/>
无效修复尝试
以下方法均未能解决问题:
- 将XML配置中的
%%替换为% - 使用Windows短路径(不含空格)替代原长路径
临时解决方案
通过taskkill /F /PID <进程ID>强制终止Artemis进程后,可正常执行服务卸载操作。
内容的提问来源于stack exchange,提问作者Jack BeNimble
相关产品推荐
相关产品推荐

