• 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

ejb-ref Sense & Practice

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I did not quite get it.
Example:
as Bean Provider I make use of the entity bean from my session bean.
i am looking it up with ctx.lookup("java:comp/env/ejb/Account");
and defining it in DD as <ejb-local-ref> ...ejb/Account..
Why am I doing so? It works fine if I just use of
ctx.lookup("ejb/Account"); along with deploying my Entity in
JNDI "ejb/Account" with vendor specific DD-XML.
I cant do without that latter step anyway, can I?
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The rationale for using env-entries instead of hardcoding the JNDI names into your Java code is... Oops. I slipped it out already
If your code refers to resources (including other EJBs) by a logical name, you don't have to worry about your chosen JNDI name being unavailable for some reason when you try to deploy your application.
 
reply
    Bookmark Topic Watch Topic
  • New Topic