This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Websphere and the fly likes ejb lookup Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "ejb lookup" Watch "ejb lookup" New topic

ejb lookup

Prannav Santhosh

Joined: May 09, 2009
Posts: 29
In case of distributed environment , if a client in machine A wants to lookup an ejb , which is deployed in machine B , Can some one tell me how do do this is WAS 6 ?

Thanks in advance.
Shivaji Byrapaneni

Joined: Oct 20, 2008
Posts: 22
it will be more or less same like the standalone client looking up EJB
as the caller will be sitting on one JVM and calee will be on another JVM

which will be something like this

InitialContext ctx = new InitialContext();
Object objref = ctx.lookup("ServiceNameYouWantToLookUp");

if you need to specify some properties then you need to go like this

props.put("java.naming.provider.url", "localhost:1099");//provide the EJB service address and port
Context context = new InitialContext(props);

this is for jboss. ihope similar things will be available for you in WAS as well
Prannav Santhosh

Joined: May 09, 2009
Posts: 29
Thank you for your help.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: ejb lookup
Similar Threads
Access JNDI
Accessing session bean in a distributed environment
Dependency Injection for remote containner
How to connect between EJB and anothe EJB in another JVM ???