aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes JNDI ... lookup on a different server ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "JNDI ... lookup on a different server ?" Watch "JNDI ... lookup on a different server ?" New topic
Author

JNDI ... lookup on a different server ?

Vijay S. Rathore
Ranch Hand

Joined: Oct 29, 2001
Posts: 449
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?


SCJP, SCJD, SCWCD1.4, IBM486, IBM484, IBM 483, IBM 287, IBM141, IBM Certified Enterprise Developer - WebSphere Studio, V5.0
Author of IBM 287 Simulator Exam
Vijay S. Rathore
Ranch Hand

Joined: Oct 29, 2001
Posts: 449
Don't worry. I got it.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
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


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Vijay S. Rathore
Ranch Hand

Joined: Oct 29, 2001
Posts: 449
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JNDI ... lookup on a different server ?