File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Logical names Vs JNDI names

 
shetal bansal
Ranch Hand
Posts: 63
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2068
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic