• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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
 
The world's cheapest jedi mind trick: "Aw c'mon, why not read this tiny ad?"
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic