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?
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.