This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Logical names Vs JNDI names Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Logical names Vs JNDI names" Watch "Logical names Vs JNDI names" New topic
Author

Logical names Vs JNDI names

shetal bansal
Ranch Hand

Joined: May 09, 2005
Posts: 63
Hi,
Can anyone tell me the difference between a "logical name" like "java:/comp/env/ejb/Fibo" and a jndi name like onl "FiboBean".
I can use both of of them as inputs to InitialContext constructor, but what is the difference?
I am new to ejb, so this might be a stupid question, but would appreciate any explanations.. .
Thanks in advance,
Shetal
[ August 19, 2005: Message edited by: shetal bansal ]
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2049
Originally posted by shetal bansal:
Hi,
Can anyone tell me the difference between a "logical name" like "java:/comp/env/ejb/Fibo" and a jndi name like onl "FiboBean".
I can use both of of them as inputs to InitialContext constructor, but what is the difference?
I am new to ejb, so this might be a stupid question, but would appreciate any explanations.. .
Thanks in advance,
Shetal

[ August 19, 2005: Message edited by: shetal bansal ]


First of all, for "java:comp/env/ejb/FiboBean":

-->"java:comp/env" is always there

-->"ejb/FiboBean" is an id that you made up yourself, that identifies the item


There are two ways you can do the lookup:

#1) specifying the whole thing "java:comp/env/ejb/FiboBean"; where 'ejb/FiboBean' is the unique id within the environment represented by "java:comp/env"

#2)
#2.a. specify the initial context as "java:comp/env/ejb"
#2.b. do the lookup using "FiboBean"

both of these #1 and #2 end up doing exactly same lookup; a look up on "java:comp/env/ejb/FiboBean"
[ August 19, 2005: Message edited by: Jesus Angeles ]
 
 
subject: Logical names Vs JNDI names
 
Similar Threads
JNDI Lookup/ejb-jar.xml to find an another ejb
Problems with EJB3.0... (continued)
Whats the need for the "ejb-ref" & "ejb-local-ref"?
Assigning JNDI names
Lookup strings question