Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To test the configuration start up your service and connect to it by using jconsole from the jdk.

 
Then you can browse to your endpoint:
 

 
 

Anchor
cxf_in_servicemix
cxf_in_servicemix

Configuring CXF to Use the ServiceMix MBeanServer

If you are embedding a CXF service in a ServiceMix container, the configuration is different. You don't want to start a new MBeanServer, instead you want to use the one that the ServiceMix container is already running. You can do this by injecting a reference to the running MBeanServer. Don't forget to add the namespace and schemaLocation to your CXF configuration file if they are not already present.

No Format

<!-- OSGi namespace and schemaLocation required -->
<beans ...
       xmlns:osgi="http://www.springframework.org/schema/osgi"
       ...      
       xsi:schemaLocation="...
       http://www.springframework.org/schema/osgi  http://www.springframework.org/schema/osgi/spring-osgi.xsd">

...

<!-- Grab a reference to the current MBeanServer -->
<osgi:reference id="mbeanServer" interface="javax.management.MBeanServer" cardinality="0..1"/>

<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="threaded" value="false" />
  <property name="daemon" value="false" />

  <!-- Inject the reference to the MBeanServer -->
  <property name="server" ref="mbeanServer" /> 
</bean>

Anchor
response_time
response_time

...