【发布时间】:2012-09-03 09:35:07
【问题描述】:
我在 Tomcat 服务器中使用 CXF 公开一个 Web 服务。 我想在 JMX 中公开一些性能信息,例如 ResponseTimeFeature 提出的那些信息。
我的cxf-beans.xml文件如下:
<cxf:bus bus="cxf" id="MyBus">
<cxf:properties>
<entry key="bus.jmx.enabled" value="true" />
</cxf:properties>
</cxf:bus>
<bean id="CounterRepository" class="org.apache.cxf.management.counters.CounterRepository">
<property name="bus" ref="cxf" />
</bean>
<jaxws:endpoint id="analyserEndpoint" implementor="#analyserImpl" address="/analyser">
<jaxws:features>
<bean class="org.apache.cxf.management.interceptor.ResponseTimeFeature" />
</jaxws:features>
</jaxws:endpoint>
这与CXF JMX page 中的解释非常相似。
问题是,当我在 [默认地址 (service:jmx:rmi:///jndi/rmi://localhost:9913/jmxrmi)] 使用 jconsole 连接时,我看不到任何性能 MBean。我有 MyBus 的管理信息和里面的服务。但是关于 ResponseTime 什么都没有(即使在对服务进行 SOAP-UI 负载测试之后)。
我在网络应用启动时记录了以下错误:
2012-09-10 15:13:19,692 ERROR org.apache.cxf.management.jmx.InstrumentationManagerImpl - Could not start JMX connector server : java.io.IOException: Cannot bind to URL [rmi://localhost:9913/jmxrmi]: javax.naming.NameAlreadyBoundException: jmxrmi [Root exception is java.rmi.AlreadyBoundException: jmxrmi]
有人知道如何解决这个问题吗?
提前致谢。
【问题讨论】:
标签: java spring tomcat cxf jmx