0 Replies Latest reply on May 20, 2003 3:31 AM by shawfly

    how to invoke a ejb form servlets

    shawfly Newbie

      I have deployed a ejb whose jndi name is ejb/Member.Aplication client can invoke the ejb using the following code.However,when I copy these codes to one of my servlet,I can only get a null home pointer.
      Please help me.Thanks very much.
      using jboss 3.2.1+tomcat 4.1.24.
      code:
      props = new Properties();
      props.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
      props.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
      props.put("java.naming.provider.url", "localhost:1099");
      try
      {
      ctx = new InitialContext(props);
      MemberHome theMemberHome = (MemberHome) ctx.lookup("ejb/Member");
      }
      catch (Exception e)
      {
      e.printStackTrace();
      }