Can't see new MBeans in JBoss 5.0

I've shared a few examples on how to add MBeans in JBoss 5.0 so that they can be configured through the JMX console, but none of those examples have ever shown up in the JMX view. Now I tried to get the ehCache JMX integration to work to no avail.

I am trying (as in ehCache documentation):

CacheManager manager = CacheManager.create("./ehcache.xml");
MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
ManagementService.registerMBeans(manager, mBeanServer, false, false, false, true);

      

I never see errors with my own or now with the ehCache version, but never appears in the JMX view. I'm wondering - are there any tweaks I need to make to configure JBoss to get it to pick up these add-ons? Am I missing something? Any hints?

Thanks for any help. I am pulling my hair out here.

+2


source to share


1 answer


If you are using JBoss with Java 5 or higher, then you will most likely have 2 MBeans running: a platform server that hosts the JVM and a JBoss MBean server that hosts the JBoss code. These two have nothing to do with each other.

Your posted code will register ehcache mbean with the JVM framework server which is not right for you.

The easiest way to get a soft link to the JBoss MBean server is



org.jboss.mx.util.MBeanServerLocator.locateJBoss()

      

Try using this instead

ManagementFactory.getPlatformMBeanServer();

      

+1


source







All Articles