Posted By:
Lasse_Koskela
Posted On:
Friday, August 30, 2002 07:37 AM
The JNDI is just an API defined by the standard java packages. Somebody has to implement the underlying service.
Ok. Usually, the JNDI tree (that is, the naming service) is implemented by the J2EE server the application code is running on. In this case, you can use the default constructor of InitialContext and it will read the standard environment properties from the environment (that is, the appserver's specified environment).
However, if you need to locate, say, an EJB deployed into a separate physical machine on your network, you can't use the local JNDI tree - the remote object is bound only to one JNDI tree. In this case, the application code must somehow specify where to look for the JNDI tree before it can look for a bound object within the JNDI tree.
The "initial context factory class" and "JNDI provider URL" are the properties (and possibly username/password) that are needed to locate the JNDI tree.