File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Dependency Injection for remote containner Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Dependency Injection for remote containner" Watch "Dependency Injection for remote containner" New topic
Author

Dependency Injection for remote containner

frank meng
Greenhorn

Joined: Jul 15, 2002
Posts: 19
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


Certified for SCJP, SCJD, SCDJWS,SCEA and IBM 141- XML& Related Technologies
Reza Rahman
author
Ranch Hand

Joined: Feb 01, 2005
Posts: 580
    
    5
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 ]

Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
frank meng
Greenhorn

Joined: Jul 15, 2002
Posts: 19
Great! Thank you Reza!

~Frank
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dependency Injection for remote containner