File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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.
I agree. Here's the link:
subject: ejb lookup
jQuery in Action, 3rd edition