我需要使用 JMX 监控 CXF 服务器并遵循 CXF Documentation .我使用 tomcat,以下是位于 /home/kalpa/applications/apache-tomcat-7.0.54/webapps/java_first_jaxws/WEB-INF/classes 的
cxf.xml
文件的内容
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<bean id="org.apache.cxf.management.InstrumentationManager" class="org.apache.cxf.management.jmx.InstrumentationManagerImpl">
<property name="bus" ref="cxf" />
<property name="enabled" value="true" />
<property name="JMXServiceURL " value="service:jmx:rmi:///jndi/rmi://localhost:9914/jmxrmi" />
</bean>
</beans>
但是我无法使用jconsole
监控数据。没有本地连接条目。
这可能是什么问题?
最佳答案
我不知道你的问题是否仍然是一个持续存在的问题,但这是我的配置:
<cxf:bus bus="cxf">
<cxf:properties>
<entry key="bus.jmx.enabled" value="true"/>
<entry key="bus.jmx.JMXServiceURL" value="service:jmx:rmi:///jndi/rmi://localhost:9914/jmxrmi"/>
</cxf:properties>
</cxf:bus>
而不是你的:
<bean id="org.apache.cxf.management.InstrumentationManager" class="org.apache.cxf.management.jmx.InstrumentationManagerImpl">
<property name="bus" ref="cxf" />
<property name="enabled" value="true" />
<property name="JMXServiceURL " value="service:jmx:rmi:///jndi/rmi://localhost:9914/jmxrmi" />
</bean>
我正在使用 CXF 3.0.2 和 JRE 1.6.0_27 中的 jconsole ...
这工作正常:
关于java - JMX 与 Apache CXF 集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23865896/