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

    InitialContext

    walter

      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
          bbalmer

          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
            acoliver

            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