| Author |
JNDI lookup of local and remote home interfaces
|
Naveen Sampra
Ranch Hand
Joined: Jun 11, 2003
Posts: 70
|
|
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.
|
 |
Sergiu Truta
Ranch Hand
Joined: Dec 16, 2003
Posts: 121
|
|
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.
|
...watch me...as I'm walking the path...
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26138
|
|
Naveen, What IDE are you using? The JNDI setup for one of the interfaces may be "hidden" somewhere.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
 |
|
|
subject: JNDI lookup of local and remote home interfaces
|
|
|