2 Replies Latest reply: Feb 28, 2007 12:18 PM by 807606 RSS



      I got an application that uses remote EJB objects that are deployed on different servers. Is it possible to specify all providers URL's in jndi.properties file or I have to specify each provider URL explicitly before obtaining initial context?:
      Properties props = new Properties();
      props.put(Context.INITIAL_CONTEXT_FACTORY,  <some factory>);
      props.put(Context.PROVIDER_URL, <some url>);
        • 1. Re: JNDI
          You will need to get references to each JNDI tree, but you don't have to do it each time. My recommendation would be singleton objects that hold those references that get initialized the first time anything tries to access that jndi tree.

          Just my thoughts on the subject, your milage may of course vary.

          • 2. Re: JNDI
            Remote EJBs provide the same interface but for some modifications.
            And I didn't want to build application each time I need to connect new remove system that provides this interface.
            I'm thinking of creating custom properties file that will contain URLs of remote providers. I will read it once and create context for each provider.