Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to use ejb environment java:comp/env/

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1855
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
A feeble attempt to tell you about our stuff that makes us money
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic