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 When to use <ejb-ref> Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "When to use <ejb-ref>" Watch "When to use <ejb-ref>" New topic
Author

When to use <ejb-ref>

Eshwar Prasad
Ranch Hand

Joined: Mar 21, 2008
Posts: 202

I am a begginer to EJB. I am executing beans through Jboss 5.0.0 Application server.

can you please help me to know why do we use <ejb-ref>. When i went through the sample code provided in company, the reference tags was extensively used in web.xml,jboss-web.xml,jboss.xml,ejb-jar.xml.

Please help
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29274
    
140

Eshwar,
EJB lookups are stored in the JNDI. You may not want your application to know the actual JNDI path. Especially since you could have two applications that use the same path. Using a reference provides a level of indirection so you don't have to change your code if the JNDI changes.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: When to use <ejb-ref>
 
Similar Threads
Problem with EJB 3. Name not bound error
Not able to excute EJB ClassCastException
EJB DI
A little help please
Lookup EJB on Different Application servers