Is it possible for the EJB container and the name server to be the same? Mu understanding is the name server (JNDI) does not actually store the objects but stores reference to an object. The bean (object) is stored in the EJB container. What data is used as a reference to the particular container/bean? Can anyone enlighten me what exactly is going on in the object lookup via JNDI.
This depends on how a container provides for JNDI. App Servers like WebLogic, Orion have provide JNDI implementations and hence "the EJB container and the name server" are the same. This approach is lightweight and has performance advantages. Secondly, it is also possible to have the EJB container separate from the JNDI provider, in which case, you may plugin various JNDI providers. In both cases, the JNDI implementation is unaware of what objects the container is storing in them. Your understanding about JNDI providers not storing actual objects is not true. JNDI maintains objects, whatever those are. For instance, in the case of an EJB, the container stores (or publishes) a proxy object in the JNDI, and that is what a client looksup for and gets it. The same happens when you declare a resource such as a DataSource in your app server. The app server creates a DataSource object and publishes it under the appropriate name in the JNDI.
------------------ Subrahmanyam Allamaraju Author of Professional Java Server Programming J2EE 1.3 Edition
Subrahmanyam Allamaraju<BR>Author of <A HREF="http://www.amazon.com/exec/obidos/ASIN/1861005377/ref=ase_electricporkchop/103-0514572-3811868" TARGET=_blank rel="nofollow">Professional Java Server Programming J2EE 1.3 Edition</A>