9 Replies Latest reply on Oct 5, 2002 8:38 AM by Adrian Brock

    Integreate custom services via MBeans

    roysun Newbie

      I tried code sample in "How to Integreate custom services via MBeans" in 3.0 document.

      The bind seems work fine. I can see jndi name and Hashtable registed on naming server through JNDIView->list. But I got a null from lookup of client code.
      The client code is as following. Thanks for help.



      Hashtable h = new Hashtable();
      h.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      h.put(Context.PROVIDER_URL, "localhost:1099");
      h.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");

      InitialContext initial = new InitialContext(h);
      Object obj = (Object) initial.lookup(jndiname);
      System.out.println("obj=" + obj);
      catch(Exception e)