2 Replies Latest reply on Feb 17, 2004 9:28 AM by Andrew Oliver

    InitialContext

    Walter Newbie

      hi, my questions is the next: how I doing to get the initialcontext in Jboss 3.2.x ??? I'm start up JBoss with option -c all.

      Thank you

        • 1. Re: InitialContext
          Brad Balmer Newbie

          How about:
          String IP = ?;
          String PORT = ?;

          Hashtable props = new Hashtable();
          props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
          props.put(Context.PROVIDER_URL, IP + ":" +PORT );
          props.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
          Context jndiContext = new InitialContext(props);

          • 2. Re: InitialContext
            Andrew Oliver Master

            Context naming = new InitialContext(); should do the trick within jboss. You do not need to/shold not provide properties in that case. However if you mean remotely, you should supply a jndi.properties file in the classpath first. Or you can do as the poster suggested below, the jndi properties gives you less rigid code. http://jboss.org/wiki/Wiki.jsp?page=AccessEJBsRemotely