如何通过基于jboss web的JMX控制台公开activemq JMX MBean?

如何通过基于jboss web的JMX控制台公开activemq JMX MBean?,jboss,activemq,jmx,Jboss,Activemq,Jmx,我一直在尝试配置activemq,以便代理MBean可以在jboss基于web的jmx控制台中使用,该控制台位于http://localhost:8080/jmx-控制台 我试过了 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance

我一直在尝试配置activemq,以便代理MBean可以在jboss基于web的jmx控制台中使用,该控制台位于
http://localhost:8080/jmx-控制台

我试过了

<?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>
知道如何使activemq MBean与jboss基于web的jmx控制台集成吗

just createConnector=false的默认设置对我不起作用,因为jboss配置为不使用1099 RMI端口。org.jboss.mx.util.MBeanServerLocator上的LocateJboss工厂方法调用是(据我所知)获取jboss MBeanServer句柄的唯一方法。

根据c,您可以尝试以下方法:

<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引用
<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>