views:

1389

answers:

1

Hello, I'm developing a EJB client. The EJB (2.1) server in deployed as Websphere 6.0 cluster. I'm doing the jndi lookup after acquirement of the InitialContent object for specific ip address using the following code:

Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTIORY,com.ibm.websphere.naming.WsnInitialContextFactory"); env.put(Context.PROVIDER_URL, "IIOP://111.111.111.111:222"); // this is the IP address of one of the cluster servers

then we create the InitialContent object. Now the question:

How do i make the lookup so it will return me a cluster wise remote interface? By cluster wise i mean the call will be not direct call to one of the EJB servers but to a mechanism of the cluster which is aware of the clustered servers.. This shout be basic thing yet i cannot find any clear documentations of this on the web. Anyone worked with Websphere 6.0 clusted EJB environment?

thanks.

+1  A: 

Even though you are pointing to one member of the cluster for the lookup the EJB that is created can be anywhere in the cluster. In fact, I once had a problem with that because I needed to get a bean on the same member and I couldn't figure out a way to guarantee it would be local. This might provide some more insight:

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/rnam_example_prop3.html

mamboking