JNDI interoperability considerations

 

This section explains considerations to take into account when interoperating with previous releases of WAS and with non-WAS JNDI clients. Also, the way resources from MQSeries must be bound to the name space has changed and is described below.

 

Interoperability with previous WAS Releases

 

EJB clients running on WAS V3.5 or V4.0 accessing EJB applications running on WAS V5

Applications migrated from previous versions of WAS may still have clients still running in a previous release. The default initial JNDI context for EJB clients running on previous versions of WAS is the cell persistent root (legacy root). The home for an enterprise bean deployed in version 5 is bound to its server's server root context. In order for the EJB lookup name for down-level clients to remain unchanged, configure a binding for the EJB home under the cell persistent root.

Note: EJB clients running in version 3.5 must be running in version 3.5.5 or above, or in version 3.5.3 or 3.5.4 with e-fix PQ51387 installed.

 

EJB clients running on WAS V5 accessing EJB applications running on WAS V3.5 or V4.0 servers

The default initial context for a WAS v3.5 or v4.0 server is the correct initial context. Simply look up the JNDI name under which the EJB home is bound.

Note: To enable WAS V5 clients to access version 3.5.x and 4.0.x servers, the down-level installations must have e-fix PQ60074 installed.

 

EJB clients running in an environment other than WAS accessing EJB applications running on WAS V5 servers

When an EJB application running in WAS V5 is accessed by a non-WAS EJB client, the JNDI initial context factory is presumed to be a non-WAS implementation. In this case, the default initial context will be the cell root. If the JNDI service provider being used supports CORBA object URLs, the corbaname format can be used to look up the EJB home. The construction of the stringified name depends on whether the object is installed on a single server or cluster, as shown below.

 

Single server

initialContext.lookup("corbaname:iiop:myHost:2809#cell/nodes/node1/servers/servername/myEJB");

According to the URL above, the bootstrap host and port are myHost and 2809, and the enterprise bean is installed in a server servername in node node1 and bound in that server under the name myEJB.

 

Server cluster

initialContext.lookup("corbaname:iiop:myHost:2809#cell/clusters/myCluster/myEJB");

According to the URL above, the bootstrap host and port are myHost and 2809, and the enterprise bean is installed in a server cluster named myCluster and bound in that cluster under the name myEJB.

The above lookup will work with any name server bootstrap host and port configured in the same cell.

The above lookup will also work if the bootstrap host and port belongs to a member of the cluster itself. To avoid a single point of failure, the bootstrap server host and port for each cluster member could be listed in the URL as follows:

initialContext.lookup("corbaname:iiop:host1:9810,host2:9810#cell/clusters/myCluster/myEJB");

The name prefix cell/clusters/myCluster/ is not necessary if boostrapping to the cluster itself, but it will work. The prefix is needed, however, when looking up enterprise beans in other clusters. Name bindings under the clusters context are implemented on the name server to resolve to the server root of a running cluster member during a lookup; thus avoiding a single point of failure.

 

Without CORBA object URL support

If the JNDI initial context factory being used does not support CORBA object URLs, the initial context can be obtained from the server, and the lookup can be performed on the initial context as follows:

 Hashtable env = new Hashtable();
 env.put(CONTEXT.PROVIDER_URL, "iiop://myHost:2809");
 Context ic = new InitialContext(env);
 Object o = ic.lookup("cell/clusters/myCluster/myEJB");

 

Binding resources from MQSeries 5.2

In previous releases of WAS, the MQSeries jmsadmin tool could be used bind resources to the name space. When used with a WAS V5 name space, the resource will be bound within a transient partition in the name space and will not persist past the life of the server process. Instead of binding the MQSeries resources with the jmsadmin tool, bind them from the WAS administrative console, under Resources in the left panel on the console


Configured name bindings
Developing applications that use JNDI
Lookup names support in deployment descriptors and thin clients