• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

ejb-ref Sense & Practice

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • 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
  • 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.
    Bookmark Topic Watch Topic
  • New Topic