EJB - JNDI lookups across 2 app server on the same machine?
Joe Boxer
Greenhorn
Joined: Oct 23, 2003
Posts: 15
posted
0
Within WSAD (could be WAS as well) 2 app servers created to run independently (the same machine, no clustering, just to servers). Server1 with an enterprise application A, Server 2 with an enterprise application B. B uses EJBs from A.
Server1: the port for the naming service is 2809 Server2: the port for the naming service is 2810
JNDI of one of the EJBs running on A is e.g. A_abc
Within application B in order to resolve the A_abc I do following
Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
Funnily the beans bound to the names space of the Server2 have the same prefix
35 (top)/nodes/localhost/servers/server1/B_xyz
Why does the lookup cannot resolve the name, since I (I guess I did) initialised the InitialContext correctly?
What do I do wrong?
thanks for any help Joe
Jorge Villalobos
Greenhorn
Joined: Nov 12, 2004
Posts: 1
posted
0
Some people and I were having the same problem and the solution we came up with (accidentally, by the way) was to replace localhost with the machine's IP address when specifying the URL, both in the ORB config in the server and on the value passed to the env variable. Apperently the app server assumes localhost means that both EARs are located on the same app server. Hope this helps, [ November 12, 2004: Message edited by: Jorge Villalobos ]
----------------------<br />Firefox 1.0. Rediscover the Web.<br /><a href="http://www.mozilla.org/products/firefox/" target="_blank" rel="nofollow">http://www.mozilla.org/products/firefox/</a>
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: EJB - JNDI lookups across 2 app server on the same machine?