0 Replies Latest reply on Nov 7, 2006 11:44 AM by Jacek Kowalski

    MBeanService + Standard MBeans = ???

    Jacek Kowalski Newbie

      Hello

      I'm using:
      JBOSS: jboss-4.0.5.GA
      java version: 1.4.2_12
      system: Windows XP Home Edition

      1. I've created one service: CFGLoaderService extending class ServiceMBeanSupport.
      2. This service creates some of standard MBeans in method start_service() using method createMBean
      3. Each standard MBean creates one important thing: object (type RuleBase - Drools library - but this is not the most important thing, i think)
      4. This object is binding to JNDI.

      At this stage of process we have:
      - one service
      - some standard MBeans
      - each MBean have reference to object, and this object is bound with JNDI

      In addition each standard MBean has method 'reload()' which creating new object, and this new object is bound with the old JNDI name. So using the same JNDI name client can locate new object.

      ServiceMBean has metod 'reload()' too. This metod calls metod 'reload' from appropiate standard MBean using mbs.invoke() method (mbs MBeanServer).

      Now unexpected (for me) result:

      Service creates Standard MBeans.
      Client locate object using JNDI and can find that object. But he cannot use this object becouse of some issues. (don't think about these issues now, look at the following description)

      Now we can open JMX console (http://localhost:8080/jmx-console/) and from standard MBean invoke method 'reload'. After this move we can locate object via JNDI and use it. Everything works fine. Now we can from JMX console use service method 'reload', which calls method 'reload' from appropiate standard MBean. After this move we can locate object via JNDI and we cannot use it (issues). How is it possible??? Service method 'reaload' calls method 'reaload' from standard MBean which works fine when called from JMX console.

      So from Service we cannot reload standard MBean. As i described at the begining after creating standard MBeans we cannot use them either. I think that happens due to the same reason for which 'reload' method from service doesn't work fine.

      If you are interested i can send you my code.

      Of course I don't have to tell you that you are my last chance to find a solution :).

      Thanks in advance
      vitor_b