Hi, The jetty.xml configuration to enable jetty MBean should be like
<!-- =========================================================== --> <New id="MBeanContainer" class="org.eclipse.jetty.jmx.MBeanContainer"> <Arg> <Ref id="MBeanServer" /> </Arg> </New> <!-- Add to the Server to listen for object events --> <Get id="Container" name="container"> <Call name="addEventListener"> <Arg> <Ref id="MBeanContainer" /> </Arg> </Call> </Get> <!-- Add to the Server as a lifecycle --> <!-- Only do this if you know you will only have a single jetty server --> <Call name="addBean"> <Arg> <Ref id="MBeanContainer" /> </Arg> </Call> <!-- Add the static log --> <Get id="Logger" class="org.eclipse.jetty.util.log.Log" name="log" /> <Ref id="MBeanContainer"> <Call name="addBean"> <Arg> <Ref id="Logger" /> </Arg> </Call> </Ref> With this, you can see the jetty mbeans, however, some MBeans miss attribute/operation. This is caused by jetty have *mbean.properties in different modules which make it very hard to be used in OSGi container, here is a jetty issue[1] tracked it and fixed for Jetty 9. As a workaround for know, need collect all *mbean.properties from different jetty modules and jar it, then put this jar in Karaf bootloader. [1]http://jira.codehaus.org/browse/JETTY-1514 ------------- Freeman(Yue) Fang Red Hat, Inc. FuseSource is now part of Red Hat On 2014-1-18, at 上午7:48, toomanyedwards wrote: > Hi all, > We are attempting to configure JMX monitoring for the Jetty instance (used > by cxf) embedded in Karaf. I have edited the jetty.xml as shown below and > can connect to Karaf via jconsole BUT I don't see the Jetty MBeans. Any > guidance is appreciated. Is there a better way to monitor the embedded > Jetty? Thanks! > > -e > > > Jetty.xml: > .... > <Call id="MBeanServer" class="java.lang.management.ManagementFactory" > name="getPlatformBeanServer"/> > > <New id="MBeanContainer" > class="org.eclipse.jetty.jmx.MBeanContainer"> > <Arg> > <Ref id="MBeanServer"/> > </Arg> > </New> > > <Get id="Container" name="container"> > <Call name="addEventListener"> > <Ref id="MBeanContainer"/> > </Call> > </Get> > ... > > -e > > > > -- > View this message in context: > http://karaf.922171.n3.nabble.com/How-to-connect-Jetty-JMX-MBeans-when-running-in-Karaf-tp4031171.html > Sent from the Karaf - User mailing list archive at Nabble.com.
