3 Replies Latest reply on Dec 23, 2003 7:06 AM by nlmarco

    ctx.lookup("java:comp/env"); times out

    nlmarco

      Hello!

      Accessing java:comp/env results in a timeout. Please help!!!

      Hashtable env = new Hashtable();
      env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.HttpNamingContextFactory");
      env.put(Context.PROVIDER_URL,"http://localhost:8080/invoker/JNDIFactory");
      env.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
      Context ctx = new InitialContext(env);

      Object obj = ctx.lookup("java:comp/env"); // Here, I get a timeout

      Best regards, Marco.

        • 1. Re: ctx.lookup(
          pvamstel

          java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
          java.naming.provider.url=localhost:1099
          java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces


          Just set thos properties. They also can be set in a jndi.properties file in your classpath somewhere

          • 2. Re: ctx.lookup(

            No the java: namespace is only available if you do
            new InitialContext()
            which has no provider url.

            Regards,
            Adrian

            • 3. Re: ctx.lookup(..) => HTTP absolutely necessary
              nlmarco

              Hello!

              Thanks a lot for your quick response!

              First: It is absolutely necessary that ALL traffic is going through http because we are developing a large application that spans over a lot of companies, servers and a lot of firewalls. Dynamic ports are a knock-out-criteria.

              Thus, I've the following question: If I use the HttpNamingContextFactory, is then the whole traffic going through http or are there still dynamic ports opened? If so, how can I avoid it?

              Did I understand that correctly: I can only use the absolute java:-notation if I'm within my server. From the client, I always need to use the relative path. Which means in jboss-IDE's XDoclet, I've always to set @ejb.util generate = "physical"?!

              Is there a way to avoid @ejb.util generate = "physical" and set this globally as default?

              Best regards, thousand thanks for your help, a merry XMas and a happy new year!!!

              Marco ;-)