Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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
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: 2061
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Logical names Vs JNDI names