This content has been marked as final.
Show 3 replies
-
1. Re: multiple hosts for JNDI providers
genman Jun 22, 2005 5:02 PM (in response to mobetter)I think you can only have one URL in there at a time. You'll have to write the logic yourself to fail over to the alternative URL if the first one fails.
-
2. Re: multiple hosts for JNDI providers
starksm64 Jun 24, 2005 8:03 PM (in response to mobetter)Comma seperated hosts/urls in the Context.PROVIDER_URL are supported.
public class TestJNDI { public static void main(String[] args) throws Exception { Properties env = new Properties(); env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); env.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces"); env.setProperty(Context.PROVIDER_URL, "jnp://badhost:1099,jnp://localhost:1099"); InitialContext ctx = new InitialContext(env); Object root = ctx.lookup(""); System.out.println(root); } }
-
3. Re: multiple hosts for JNDI providers
mobetter Jun 29, 2005 2:30 AM (in response to mobetter)thanks for the info ... will try it out ...