[jboss-user] [JNDI/Naming/Network] - JNDI lookup across partitions and local

haribaasha do-not-reply at jboss.com
Wed Oct 3 03:25:01 EDT 2007


Hi
       I use a servicelocator which is a generic class which will return to me a remote stub based on the ejb requested with a jndi name. so i have about 3 different ejbs providing different services running in a cluster. now one of the ejb runs in a totally different partition.  I do the lookup using


              Properties p = new Properties();
              p.put("jnp.partitionName", "IndicsPartition");    //indicspartition is my partition name
             p.put("jnp.discoveryGroup", "230.0.0.4");
              Context initial = new InitialContext(p);

the other ejb's are deployed locally or in the same cluster. for the local or remote lookup in a cluster we already have 
          Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
                    p.put(Context.URL_PKG_PREFIXES,"jboss.naming:org.jnp.interfaces");
                    p.put(Context.PROVIDER_URL, "localhost:1100"); // HA-JNDI port
                     initial = new InitialContext(p);

Do i need to have these both as different cases and try each or can i have one context which will be able to load it from IndicsPartition if available or from teh local cluster if availbale ? 

Thanks
hari

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4090905#4090905

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4090905



More information about the jboss-user mailing list