This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Whats the need for the 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 "Whats the need for the "ejb-ref" & "ejb-local-ref"?" Watch "Whats the need for the "ejb-ref" & "ejb-local-ref"?" New topic
Author

Whats the need for the "ejb-ref" & "ejb-local-ref"?

Anthony Cheung
Greenhorn

Joined: Sep 18, 2003
Posts: 3
I can still call other ejbs after a JNDI lookup even if i don't use an ejb-local-ref tag?
Also, i get lookup exceptions when i use xdoclet generated util objects that use the COMP_NAME for lookup? How do i fix this? (I'm using jboss)
thanks
Anthony Cheung
Greenhorn

Joined: Sep 18, 2003
Posts: 3
ok, i think i found out the problem
xdoclet generated the wrong COMP_NAME to use because i left out the "ref-name" tag.
and ejb-local-ref is required so the ejb is bound to java:comp namespace
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
I can still call other ejbs after a JNDI lookup even if i don't use an ejb-local-ref tag?

The ejb-ref and ejb-local-ref mappings are intended for avoiding hardcoded JNDI names within your EJB code. So, you can access other EJBs via their real JNDI name even if you haven't added ejb-ref's for them, but you can't use logical/private JNDI names for the lookup without those mappings.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Whats the need for the "ejb-ref" & "ejb-local-ref"?
 
Similar Threads
About remote client
Need help on EJB2.0 Local interfaces
Lookup EJB on Different Application servers
Jboss and Ejb 2.1 ejb-ref lookup
How to lookup an EJB in Servlets?