By the time the application is actually deployed, all ejb-refs must be bound to real JNDI names either directly, or through ejb-links if any.
Section 20.3.3 of ejb-2_0-fr2-spec reads in part:
The Deployer must ensure that all the declared EJB references are bound to the homes of enterprise beans that exist in the operational environment. The Deployer may use, for example, the JNDI LinkRef mechanism to create a symbolic link to the actual JNDI name of the target enterprise bean's home.
...
If an EJB reference declaration includes the ejb-link element, the Deployer should bind the enterprise bean reference to the home of the enterprise bean specified as the link's target.
In 3.1.3, the spec required the Deployer to resolve all external dependencies declared by the Bean Provider. Further, in 20.3.4, the spec requires container deployment tools to inform the Deployer of any "unresolved EJB references" and allow him or her to resolve it.
So if the Bean Provider specifies an ejb-ref, then a) the Assembler may resolve the reference using ejb-link; or failing that, b) the Deployer must resolve the reference, using a container-specific mechanism.
Here's a concrete example using Weblogic:
(ejb-jar.xml)
If the Application Assembler doesn't specify a link, then the Deployer must bind the reference using a weblogic-specific mechanism:
(weblogic.xml)
-Ade Barkah
Edit: part of post was missing, trying again.
[ April 05, 2004: Message edited by: Ade Barkah ]