[jboss-user] [Management, JMX/JBoss] - Lookup Singleton MBean

niefeng do-not-reply at jboss.com
Mon Jun 11 13:59:39 EDT 2007


Hi all,

I followed the configuration as specified on the OnJava.com (http://www.onjava.com/pub/a/onjava/2003/08/20/jboss_clustering.html) to configure a singleton MBean within the cluster env.

However, i have problem on locating the singleton MBean. Below is my excerpt of my code on getting the mbean.


  | String mbeanName = mbeanName = getServiceMBeanName();
  |     MBeanServer server = MBeanServerLocator.locate();
  |     AServiceMBean mbean = (AServiceMBean)MBeanProxyExt.create(AServiceMBean.class, mbeanName, server);
  |     System.out.println("is Master node: "+mbean.isMasterNode());
  | 

The isMasterNode status will be true if the mbean is started as the singleton.

On node 1, i tried to run the code and the above code stated it is a master node. On node 2, i tried the same thing, but i can't locate the singleton MBean cos the status i get is showng false.

Seem like the MBean i am getting is from the Node2 MBeanServer instead of the Node1 mbean server.

Is the way i perform the look up wrongly?

Many thanks

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4053237#4053237

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4053237



More information about the jboss-user mailing list