• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

JNDI lookup of local and remote home interfaces

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
EJB2.0 is supposed to support dual-role beans, where both a local and a remote interface are present in the same bean for maximum flexibility.
But when you do the JNDI lookup to locate the bean, you can create JNDI to locate only one type, i.e home or remote. So, if I have an EJB client that is deployed locally, but wants to use the local interface(on one occasion) AND remote interface(on another occasion) how do you configure the JNDI for the bean to do both.
Can anyone help me with this.
 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You simply use different JNDI names for the interfaces (i.e. "BeanLocal" and "BeanRemote") and use the appropriate one when looking for the interface you want.
Here's some sample from one deployment descriptor of mine:
<session>
<ejb-name>DepartmentManager</ejb-name>
<jndi-name>DepartmentManager</jndi-name>
<local-jndi-name>DepartmentManagerLocal</local-jndi-name>
</session>
When I want to use the local interface I lookup for the "DepartmentManagerLocal" home interface, and when I want to use the bean remotely I lookup for the "DepartmentManager" home interface.
Hope it's all clear now.
 
author & internet detective
Posts: 40913
840
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Naveen,
What IDE are you using? The JNDI setup for one of the interfaces may be "hidden" somewhere.
 
reply
    Bookmark Topic Watch Topic
  • New Topic