• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to use ejb environment java:comp/env/

 
Steven Gao Song
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, everyone,

I find that if we want to refer other enterprise bean in one
bean, we lookup it from the context -- lookup("java:comp/env/ejb/XXXX")

But, if we want to get the home stub in the client-side,
we just look it up by only providing the bean name, like, lookup("Advisor").

What's the difference?

Thank you.
 
Darya Akbari
Ranch Hand
Posts: 1855
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good question .

Both of your examples should give you the home stub. Maybe lookup("Advisor") works only for the J2EE RI.

Can you post the ejb-jar.xml file?

Regards,
Darya
 
Steven Gao Song
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have no ejb-jar.xml file at all. I came out this question when I was doing
some exercise.

By the way, what is J2EE RI? Does it mean J2EE client?

Thank you.
 
Darya Akbari
Ranch Hand
Posts: 1855
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suppose that you are reading HFEJB . The Advisor example in that book is built with the deploytool.

The J2EE RI is the reference implementation (RI) of the J2EE 1.3 server described in HFEJB.

At the end of the Advisor example you get this ejb-jar.xml file. Once you have that file you can post it here or check yourself for the term Advisor and see how it was stored.

Regards,
Darya
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic