【问题标题】:How to expose activemq JMX MBeans via jboss web based jmx-console?如何通过基于 jboss web 的 jmx-console 公开 activemq JMX MBean?
【发布时间】:2013-06-20 08:12:08
【问题描述】:

我一直在尝试配置 activemq,以便代理 MBean 在 jboss 的基于 Web 的 jmx-console 中可用,地址为 http://localhost:8080/jmx-console

我试过了

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"     xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"     xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:util="http://www.springframework.org/schema/util"     xmlns:amq="http://activemq.apache.org/schema/core"
xsi:schemaLocation="http://www.springframework.org/schema/beans     http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/mvc     http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
http://www.springframework.org/schema/tx     http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/context     http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/util     http://www.springframework.org/schema/util/spring-util-3.1.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-    core.xsd">
<beans>
    <broker xmlns="http://activemq.apache.org/schema/core" useJmx="true"
        useShutdownHook="false">
        <!-- Use the following to configure how ActiveMQ is exposed in JMX -->
        <managementContext>
            <!-- <managementContext createConnector="false" /> -->
            <managementContext>
                <MBeanServer>
                    <bean class="org.jboss.mx.util.MBeanServerLocator"
                        factory-method="locateJBoss" xmlns="" />
                </MBeanServer>
            </managementContext>
        </managementContext>
    </broker>
</beans>

当我部署战争时,xml 给出了错误

cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'bean'.

知道如何使activemq MBeans 与基于jboss web 的jmx-console 集成吗?

只有 createConnector=false 的默认设置对我不起作用,因为 jboss 配置为使用 1099 RMI 端口。 LocateJboss factory-method call on org.jboss.mx.util.MBeanServerLocator 是获取 jboss MBeanServer 句柄的唯一方法(我知道)。

【问题讨论】:

    标签: jboss activemq jmx


    【解决方案1】:

    根据spring JMX doc,你可以试试这样的:

    <bean id="exporter" class="org.springframework.jmx.export.MBeanExporter">
         <property name="server">
           <bean id="mBeanServerLocator" class="org.jboss.mx.util.MBeanServerLocator" 
                        factory-method="locateJBoss" />
         </property>
      </bean>
    <broker xmlns="http://activemq.apache.org/schema/core" useJmx="true"
            useShutdownHook="false">
            <!-- Use the following to configure how ActiveMQ is exposed in JMX -->
            <managementContext>
                <managementContext MBeanServer="exporter"/>     
                <!-- I am not sure what MBeanServer attribute is waiting for (a ref, an id, something else ...)-->
            </managementContext>
        </broker>
    

    【讨论】:

    • 在试用此代码后,Spring 抱怨说“exporter”应该是字符串,而不是 行中的 bean 引用
    猜你喜欢
    • 2019-04-30
    • 2016-02-18
    • 2016-08-18
    • 2010-10-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多