Submitted By: Albert Lee on 02/13/2002 at 08:32 AM
Subject: Re: JNDI name(s) when using local and remote interface
In pre-EJB 2.0, locating remote home using direct JNDI lookup (e.g. "ejb/ABeanRemoteHome") is a normal practice and it is still supported in WSTD for compatibility.
In EJB 2.0, the preferred way to locate home is to use "Enterprise Bean Environment", i.e. use of the "java:com/env" JNDI name space via EJB Reference
Look at the EJB 2.0 spec chapter 20.
220.127.116.11 EJB reference programming interfaces
The Bean Provider "MUST" use EJB references to locate the home interfaces of other enterprise beans as follows.
? Assign an entry in the enterprise bean?s environment to the reference. (See subsection 18.104.22.168 for information on how EJB references are declared in the deployment descriptor.)
? The EJB specification recommends, but does not require, that all references to other enterprise beans be organized in the ejb subcontext of the bean?s environment (i.e., in the java:comp/env/ejb JNDI context).
? Look up the home interface of the referenced enterprise bean in the enterprise bean?s environment using JNDI.
Local interface is only visible within the same appl server, therefore disallow the binding of the local home to the JNDI name space.