[jboss-jira] [JBoss JIRA] Created: (JBAS-5799) HAJNDI lookup clarification

Galder Zamarreno (JIRA) jira-events at lists.jboss.org
Thu Jul 24 04:10:46 EDT 2008


HAJNDI lookup clarification
---------------------------

                 Key: JBAS-5799
                 URL: https://jira.jboss.org/jira/browse/JBAS-5799
             Project: JBoss Application Server
          Issue Type: Task
      Security Level: Public (Everyone can see)
          Components: Documentation
    Affects Versions: JBossAS-4.2.3.GA, JBossAS-5.0.0.CR1
            Reporter: Galder Zamarreno
            Assignee: Samson Kittoli


In AS documentation, in the clustering section, it says:

"For clients running inside the application server. 

If you want to access HA-JNDI from inside the application server, you must explicitly get an InitialContext 
by passing in JNDI properties. The following code shows how to create a naming Context bound to HA-JNDI:

    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.
    return new InitialContext(p); "

As explained in http://wiki.jboss.org/auth/wiki/JBossHAJNDIUseCluster I think this section below should 
appended to the comment above.

"However, this does not work in all cases, especially when running a multi-homed cluster (several JBoss 
instances on one machine bound to different IPs). A safer method is not to specify the Context.PROVIDER_URL 
(which does not work in all scenarios) but the partition name property:

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("jnp.partitionName", "DefaultPartition"); // partition name.
return new InitialContext(p); "

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list