Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ejb lookup

 
Prannav Santhosh
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
props.put("java.naming.factory.url.pkgs",
"org.jboss.namingrg.jnp.interfaces");
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
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your help.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic