1 Reply Latest reply on Sep 13, 2004 9:47 AM by Scott Stark

    How to dynamically register a MBean?

    ben_vbe Newbie

      Is it possible to register a MBean dynamically? If yes, how?
      I tried to use:

      MBeanServer server = null;
      Context c = new InitialContext();
      RMIAdaptor a = (RMIAdaptor)c.lookup("jmx/rmi/RMIAdaptor");
      server = new RMIConnectorImpl(a);
      ObjectName tpMBeanName = new ObjectName("myapp:service=myservice");
      server.registerMBean(inMBean, tpMBeanName);

      where inMBean is my DynamicMBean implementation.
      I receive a exception:
      org.jboss.util.NestedRuntimeException: error marshalling arguments; nested exception is:

      Someone can help me please?