You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows环境下Apache ActiveMQ Artemis登录控制台启动报错

解决Windows下ActiveMQ Artemis登录控制台时的文件路径错误问题

我之前在Windows环境部署Apache ActiveMQ Artemis的时候,也碰到过和你完全一样的报错!这个问题的根源很明确——Windows系统的文件路径被错误解析成了URL格式(带file:\前缀),导致系统找不到正确的配置文件位置。

问题分析

看报错信息里的路径:file:\C:\var\lib\mybroker\etc\artemis-roles.properties,正常Windows本地文件路径根本不会带file:\前缀,这说明broker生成的登录配置文件里,路径格式没有适配Windows系统。

具体解决步骤

  1. 定位到你的broker配置目录,找到login.config文件,路径是:C:\var\lib\mybroker\etc\login.config
  2. 用文本编辑器打开这个文件,找到activemq配置段,你会看到类似这样的内容:
    activemq {
        org.apache.activemq.artemis.spi.core.security.jaas.PropertiesLoginModule required
            debug=false
            reload=true
            org.apache.activemq.jaas.properties.user="file:${artemis.instance}/etc/artemis-users.properties"
            org.apache.activemq.jaas.properties.role="file:${artemis.instance}/etc/artemis-roles.properties";
    };
    
  3. 把配置里的file:前缀去掉,修改后的配置应该是:
    activemq {
        org.apache.activemq.artemis.spi.core.security.jaas.PropertiesLoginModule required
            debug=false
            reload=true
            org.apache.activemq.jaas.properties.user="${artemis.instance}/etc/artemis-users.properties"
            org.apache.activemq.jaas.properties.role="${artemis.instance}/etc/artemis-roles.properties";
    };
    
    如果你担心变量解析有问题,也可以直接写绝对路径,比如C:\var\lib\mybroker\etc\artemis-users.properties,不过用变量更灵活,方便后续迁移。
  4. 保存修改后的login.config文件,然后重启你的ActiveMQ Artemis服务。

重启之后再访问http://localhost:8161/console,应该就能正常登录了。

补充说明

这个问题是因为Artemis默认的配置是针对Unix/Linux系统的,在这些系统里用file:前缀指定本地文件是标准写法,但Windows系统的路径解析逻辑不支持这种格式,所以去掉file:前缀就能让系统正确识别本地文件路径了。

内容的提问来源于stack exchange,提问作者Fernando Guardiola

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 03:54:30