Skip to content
Branch: master
Find file History
Type Name Latest commit message Commit time
Failed to load latest commit information.

Apache Karaf MBean example


This example shows different ways to register a JMX MBean in the Apache Karaf MBeanServer.

It exposes a MBean interacting with a BookingService.


  • karaf-mbean-example-api is a common bundle providing the Booking POJO and a BookingService interface.
  • karaf-mbean-example-provider is a very simple bundle providing a BookingService implementation.
  • karaf-mbean-example-simple is a bundle doing a MBean registration using the Karaf util
  • karaf-mbean-example-blueprint is a bundle doing a MBean registration using blueprint
  • karaf-mbean-example-scr is a bundle doing a MBean registration using SCR


The build uses Apache Maven. Simply use:

mvn clean install

Features and Deployment

On a running Karaf instance, register the features repository:

karaf@root()> feature:repo-add mvn:org.apache.karaf.examples/karaf-mbean-example-features/LATEST/xml

Then you can install the service provider feature:

karaf@root()> feature:install karaf-mbean-example-provider

Then you can test the different registration approach:

  • To use the Karaf util registration, you install the karaf-mbean-example-simple feature:
karaf@root()> feature:install karaf-mbean-example-simple
  • To use the blueprint registration, you install the karaf-mbean-example-blueprint feature:
karaf@root()> feature:install karaf-mbean-example-blueprint
  • To use the SCR registration, you install the karaf-mbean-example-scr feature:
karaf@root()> feature:install karaf-mbean-example-scr


Once you have installed a feature registering the MBean, you can see the MBean using any JMX client, like jconsole.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.