0 Replies Latest reply on Sep 30, 2003 9:13 PM by jakkar

    registering dynamic MBeans

    jakkar Newbie

      Hi, hopefully somebody will be able to help me out a bit on this one..

      I'm trying to load an unknown number of MBeans into the MBeanServer. I works like this... when I initialize a servlet of mine I recieve a listing of services that are to be registered as MBeans. The code I use for that now does seem to register the MBeans that I generate, but When I try to perform any of the management methods eg: stop(),start(), etc... they don't seem to be getting called. anyone have any ideas..??
      Here's the code that tries to register the newly made MBeans:
      String classPath = (String)commsClasses.get(keyList.get(i));
      CommsServiceController commController = new CommsServiceController(classPath, (String)keyList.get(i));
      try
      {
      server.registerMBean(commController, new ObjectName("mil.navy.spawar.nsips:service=".concat(String.valueOf(String.valueOf(keyList.get(i))))));
      }
      catch(Exception e)
      {
      System.out.println("CommsServiceLoader.CommsBeanMaker: Error registering COMM MBeans on the server. ".concat(String.valueOf(String.valueOf(e))));
      }


      I'm not sure if I'm missing something simple here or not.

      any help would be great!

      Thanks..