1 Reply Latest reply on Jul 27, 2010 2:20 PM by 791266

    How to register two MBeans onto the same domain

      Hi All,
      I wrote the following code to register to MBeans onto the domain "HelloAgent2".But,it is not working.Can i register two MBeans like this or do i need to use loggers to register the second MBean.

      MBeanServer mbs = null;
      mbs = MBeanServerFactory.createMBeanServer( "HelloAgent2" );

      SampleDynBean2 sample=new SampleDynBean2();//Dynamic MBean
      SampleDynBean3 sample2=new SampleDynBean3();//Dynamic MBean

      ObjectName sobj2=null;
      ObjectName sobj3=null;

      sobj3=new ObjectName("SamDynBean3:bean=sample");
      sobj2=new ObjectName("SamDynBean2:bean=sample");
      mbs.registerMBean(sample, sobj2);

      Mail Me:x_netala@ugs.com