aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Can I perform JNDI namespace lookup across EJB containers? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Can I perform JNDI namespace lookup across EJB containers?" Watch "Can I perform JNDI namespace lookup across EJB containers?" New topic
Author

Can I perform JNDI namespace lookup across EJB containers?

Victor Su
Greenhorn

Joined: Aug 22, 2001
Posts: 8
Hi,
I have read the following section online and I just can't figure out what it means:
Does it mean it is possible to perform the EJB look up across different EJB containers? According to the following scenario:
"...You should be using the EJB-ref mechanism to hook your EJBs together. You can use direct JNDI names but this is inflexible and does not leave any room for the Container to optimize access to collocated beans. For example, say you have a deployment where beans A and B are both replicated in two different containers, for performance and/or availability reasons. Clearly, you want every instance of A in container one to use instances of B also in container one. Likewise for container two. An EJB container can enforce this locality constraint using ejb-links, but not always using direct JNDI names... "
Thanks for your help!!
Victor


Victor
Victor Su
Greenhorn

Joined: Aug 22, 2001
Posts: 8
Sorry, I just fogot to ask the following question regarding to the topic I last made:
If we can perform the JNDI name look for the EJB with the same JNDI name living in different EJB containers, how to achieve that?
Thanks !
Victor
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16068
    
  21

JNDI is provided via a server. So you have to address the JNDI server (host and port address) that's associated with the container you're interested in.


Customer surveys are for companies who didn't pay proper attention to begin with.
Victor Su
Greenhorn

Joined: Aug 22, 2001
Posts: 8
Originally posted by Tim Holloway:
JNDI is provided via a server. So you have to address the JNDI server (host and port address) that's associated with the container you're interested in.

Hi, Tim,
Thanks very much for your reply! I am actually working on the project in a bank in migrating stuff from IBM's Websphere 3 to the new WAS 4 platform. Though the JNDI name look up is not the big issue in this mirgration, IBM will provide the support for distributed JNDI name look up in its latest WAS 5.0 environment. Therefore, I raised the question in the JavaRanch.
However, I just want to ask the further question, if you've got the time:
In this case, we've got two EJB A and B (with the same JNDI name) deployed and living in two different EJB containers
How to make the JNDI server to associate with the specific container for EJB A and B? How can the JNDI server know which EJB is being called (for example the Workload Manager to balance traffics to those two EJBs).
I am pretty a greenhorn in this issue and it would be of much appreciated if you could point me to a site or document to explain the issue in more details.
Thanks very much for your help!

Victor
Kiran Kumar
Ranch Hand

Joined: May 18, 2001
Posts: 107
hi
whileu create the initial context for the server which is providing the jndi service u can specify the provider url of the server with the ejb container u r interested in. so with the initial context created for the specified server when u lookup and request a bean the server will return u the home interface of the bean through object serialization.
hope this helps.
pl try ibm redbooks for detailed explaination or the www.webspherepro.com for a tutorial based explaination of the websphere server since u r working on websphere and more interested in websphere.


Thanks<br /> <br />Kiran <br /> <br />SCEA, SCJP 1.4,<br /> <br />"First they ignore u, then they laugh at u, then they fight u, <br />then u will win<br /> <br />Mahatma Gandhi"
Victor Su
Greenhorn

Joined: Aug 22, 2001
Posts: 8
Hi, Kiran,
Thanks very much for your message!
However, could you give me the further details of the following:
How to specify the provider url of the server with the specific ejb container? Note that in this scenario: we've got two EJBs with the same JNDI names sitting in two different EJB containers in the same application server. could you me give an example?
Following is the extract of your reply:"...
whileu create the initial context for the server which is providing the jndi service u can specify the provider url of the server with the ejb container u r interested in..."
Thanks!
Victor
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can I perform JNDI namespace lookup across EJB containers?