Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dependency Injection for remote containner

 
frank meng
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can someone tell me how to inject a remote EJB reference? For example, I have a Web app deployed on machine A, and an EJB deployed on machine B. How do I refer to the EJB in my web app? Lookup is not an option in my case.

Thanks,
Frank
 
Reza Rahman
author
Ranch Hand
Posts: 580
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Frank,

You can do it two ways other ways besides look-up:
1. Use jndi.properties to point to the remote server.
2. You can use app-server specific global JNDI naming to connect to a remote EJB via DI/@EJB/XML DD.

Here is a reference for GlassFish as a starting point: https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html. Here is a helpful forum discussion: http://forums.java.net/jive/message.jspa?messageID=254961.

Regards,
Reza
[ December 02, 2008: Message edited by: Reza Rahman ]
 
frank meng
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Great! Thank you Reza!

~Frank
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic