I'm exposing a Web service using CXF inside a Tomcat server. I would like to expose in JMX some performance information like those proposed by the ResponseTimeFeature.
My cxf-beans.xml file is as follows:
<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>
Which is very similar to what is explained in CXF JMX page.
The problem is that when I connect using the jconsole at the [default address (service:jmx:rmi:///jndi/rmi://localhost:9913/jmxrmi)], I can't see any performance MBean. I have management information of MyBus and the service inside. But nothing about ResponseTime (Even after a SOAP-UI load test over the service).
I have the following error logged at web app start up:
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]
Does someone has any idea on how to solve this problem?
Thanks in advance.