I'm a little confused as to the purpose of the ejb-ref and ejb-link fields in the xml deployment descriptor of an ejb. Whenever I need a reference to another ejb from an ejb, I use jndi. What is the purpose of putting in the information in the deployment descriptor?
When your bean cannot know the JNDI name of the target beans at compile time, so they are listed in the DD as references. At runtime , your bean will look up its references by name , and should obtain as return values references to beans that represent your target beans.
For this to work , you must have an ejb-link entry within each ejb-ref.
This mechanism allows the roles of EJB (deployer, app assembler) to be played out. This way your code is not dependent on a hardcoded string that may change at deployment time. The "deployer" should set the ejb-link as to the actual jndi-name.
Ed Roman once said, "another layer of indirection will solve any problem.."
Does anyone know how this binding by the deployer is done in IAS ??
Thanks in advance