This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Websphere and the fly likes ejb lookup problem on diff servers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "ejb lookup problem on diff servers" Watch "ejb lookup problem on diff servers" New topic
Author

ejb lookup problem on diff servers

Gavi Raaghav
Ranch Hand

Joined: Apr 28, 2005
Posts: 82
I am trying to lookup a bean deployed on server2 from my client deployed on server1.
The bean is a stateless session bean with the jndi name as ejb/Ejb1Home.
I am successfully able to lookup the bean from the client residing on server2 but the client on server1 fails to locate the bean.

Here is the code used in the client on server1:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
env.put(Context.PROVIDER_URL,"corbaloc:iiop:localhost:9086");
Context ctx = new InitialContext(env);
System.out.println(ctx+"****####");
Ejb1Home home1 = (Ejb1Home)ctx.lookup("ejb/Ejb1Home");

Since both the servers are running on the same machine (WSAD) i have used localhost.But the bootstrap port of server2 is 9086 whereas bootstrap of server1 is 2089.

This is the error i am getting on lookup:
javax.naming.NameNotFoundException: Context: localhost/nodes/localhost/servers/server1, name: ejb/Ejb1Home: First component in name ejb/Ejb1Home not found. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL mg.org/CosNaming/NamingContext/NotFound:1.0

Any pointers will be highly appreciated.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ejb lookup problem on diff servers
 
Similar Threads
New to EJB
EJB - JNDI lookups across 2 app server on the same machine?
ejb lookup problem on diff servers
Issues testing Session Bean
Standalone Java EJB client