嵌入式ActiveMQ Artemis Web控制台加载异常问题排查
嵌入式ActiveMQ Artemis Web控制台导航栏缺失问题解决
问题现象
- 完成嵌入式ActiveMQ Artemis配置后,Web控制台可通过
login.config设置的账号密码正常登录,但顶部队列、会话、生产者等核心导航栏完全缺失 - 直接访问
consoleHost:8161显示异常页面,仅consoleHost:8161/console能正常跳转至登录页 - 日志对比发现关键差异:
独立Artemis实例日志:
[hawtio-jmx-rbac] Using mbean hawtio:type=security,area=jmx,name=ArtemisJMXSecurity for client-side role based access control
嵌入式实例日志:[hawtio-jmx-rbac] Using mbean hawtio:type=security,area=jmx,rank=0,name=HawtioDummyJMXSecurity for client-side role based access control - 查看
artemis-plugin.war内的webapp/plugin/js/components/navigation.js文件,确认导航栏显示依赖Artemis专属MBean服务器,推测问题根源是嵌入式实例未正确关联该服务器
解决方法
在原配置步骤的webServerDTO.addBinding(bindingDTO);之后、webServerComponent.configure(webServerDTO, pathToArtemis, pathToArtemis);之前,添加以下代码:
ActiveMQSecurityManager securityManager = server.getActiveMQServer().getSecurityManager(); ManagementContextDTO managementDTO = new ManagementContextDTO(); ManagementContext managementContext = ManagementFactory.create(managementDTO, securityManager); server.getActiveMQServer().getManagementService().registerHawtioSecurity(managementContext.getArtemisMBeanServerGuard());
注:无需自定义management.xml文件,上述代码会启用默认安全配置
内容的提问来源于stack exchange,提问作者Cooper Jones
相关产品推荐
相关产品推荐

