3 Replies Latest reply on Apr 5, 2002 5:57 AM by Adrian Brock

    ModelMBean setManagedResource(EJBHandle..)

    Susan Newbie


      I'm trying to manage an ejb by ModelMBean.
      But in HTMLAdapterView of the ModelMBean,
      where should shown the manageable attribute ("number") of the ejb is always the exception:

      javax.management.MBeanException wraps [javax.management.ReflectionException: The method null.getNumber could not be found]

      Maybe something is wrong by setting the ejbHandle:
      Here is my source code

      InitialContext jndiContext = new InitialContext();
      Object ref = jndiContext.lookup("demo/Demo");

      DemoHome home = (DemoHome)
      PortableRemoteObject.narrow(ref, DemoHome.class);

      Demo demo = home.create();
      javax.ejb.Handle handle = demo.getHandle();

      RequiredModelMBean model = new RequiredModelMBean();
      model.setManagedResource(handle, "objectReference");

      Any help is welcome! Thank you very much...