0 Replies Latest reply on Jun 20, 2008 12:16 PM by madeinstein

    Binding MBean to JNDI

    madeinstein Newbie

      Hi i've found this article that explains how to bind MBean to JNDI


      But for some reason I can't get the object back using JNDI lookup, it's always null

      Object obj = remoteCtx.lookup("service/Engine");

      The jndi is correct for sure because there is no NamingException and I can see the name in JndiView

      I've added some debuging code to rebind() method to be sure that the object is being put to the Context but this look ok, see below.

      Name fullName = rootCtx.getNameParser("").parse(jndiName);
      System.out.println("Binding to '"+fullName+"' object: "+getObjectToBind());
      NonSerializableFactory.rebind(fullName, getObjectToBind(), true);


      [STDOUT] Binding to 'service/Engine' object: core.EngineService@4e94a4

      Any ideas what's missing?