Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ejb lookup on a diff server

 
Gavi Raaghav
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My app is running on appserver1 and i need to access an ejb deployed on appserver2 from appserver1.How do i achieve this?
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gavi,

All you need to do is to initialize the initial context properly. You�ll need to set at least couple of properties (they could be more if your beans on the other server are jndi protected) like this:

All your components deployed to the appserver1 that needs to access components deployed to appserver2 need to include code similar to the one above. Ideally through a service locator.
Regards.
 
Annie Smith
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course, you will need the EJB client JAR containing the home and remote interfaces for the EJB, which has to be invoked, available to the other one.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic