+

Search Tips   |   Advanced Search

 

JNDI interoperability considerations

 

You must take extra steps to enable your programs to interoperate with non-WAS JNDI clients and to bind resources from MQSeries to a name space.

 

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

When an EJB application running in WAS V5 or V6 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 is 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.

Single server

Following is a URL that has the bootstrap host myHost, the port 2809, and the enterprise bean installed in the server server1 in node node1 and bound in that server under the name myEJB:

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

Server cluster

Following is a URL that has the bootstrap host myHost, the port 2809, and the enterprise bean installed in a server cluster named myCluster and bound in that cluster under the name myEJB:

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

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

The lookup also works if the bootstrap host and port belong to a member of the cluster itself. To avoid a single point of failure, the bootstrap server host and port for each cluster member can 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 releases previous to WAS V5, the MQSeries jmsadmin tool could be used to bind resources to the name space. When used with a WAS V5 or V6 name space, the resource is bound within a transient partition in the name space and does not persist past the life of the server process. Instead of binding the MQSeries resources with the jmsadmin tool, bind them from the console, under Resources in the console navigation tree.


 

Related concepts


Configured name bindings

 

Related tasks


Developing applications that use JNDI

 

Related Reference


Lookup names support in deployment descriptors and thin clients

 

Related information


Naming service is the same for both versions 5 and 6.">Naming in WebSphere Application Server V5: Impact on Migration and Interoperability

 

Reference topic