• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JNDI ... lookup on a different server ?

 
Vijay S. Rathore
Ranch Hand
Posts: 449
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure weather this question is already answered, but still it goes like:
I have two servers running in WSAD4.0 (say localhost:8080 ORB port 900 and localhost:8085 ORB port 905). I want to access a bean from one server to another using JNDI (from 8080 to 8085).
To test that I have created two clients, one in the same server (8080) where EJB lies and the other on a different server (8085).
The client code works great in the same server space (8080), but as soon as I invoke the client from another server the reference returned is null.
Code that works on localhost:8080 is :
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
env.put(Context.PROVIDER_URL, "iiop://localhost:900/");
Context initialContext = new InitialContext(env);
Object objref = initialContext.lookup(ejb/com/test/common/model/SomeServiceHome");
out.println("<P>Address of JNDI " + objref.toString() );
Same code dosen’t work on localhost:8085

Do I have to do any settings while running the server?
 
Vijay S. Rathore
Ranch Hand
Posts: 449
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't worry. I got it.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good news. Of course, it would be nice if you would be able to post the solution so that a fellow rancher might benefit from your prior experience
 
Vijay S. Rathore
Ranch Hand
Posts: 449
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure
[b]I found a very interesting article on IBM website
Here is the link and the white paper just in case the link dosen't work:
http://www-106.ibm.com/developerworks/java/library/j-namespace.html
(Marilyn deleted copywrite-violating-text)
[ January 01, 2004: Message edited by: Marilyn de Queiroz ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic