
If your bean accesses (looks up) other enterprise beans, you have to declare an EJB reference for each bean that is referenced. If your bean will access the referenced bean locally, you have to declare a local EJB reference (by using the <ejb-local-ref> element). If your bean will access the referenced bean remotely, you have to declare a remote EJB reference (by using the <ejb-ref> element).
A dialog box appears.
The selected enterprise beans appear as sub-nodes under the ejb-ref or the ejb-local-ref node correspondingly. The required fields are automatically completed. You can modify the EJB Reference Name and specify a description for the EJB reference.
To remove an EJB reference, select it and choose Remove.
If the information in the <ejb-ref> or <ejb-local-ref> element is not sufficient to identify the referenced bean (for example, more than one bean with the same interfaces is deployed on the J2EE Engine), you also have to define the referenced bean that will be accessed by your enterprise bean. Therefore, you have to specify the JNDI name of the referenced enterprise bean (that is, the name under which the referenced bean is registered in the JNDI namespace) in the ejb-j2ee-engine.xml. In such cases proceed as follows:
A dialog box, which contains the corresponding EJB references declared in ejb-jar.xml, appears.
The EJB reference appears in the enterprise bean tree structure.
When you look up the referenced enterprise bean, use the name that you have specified in the EJB Reference Name field in step 6 above. This name is stored in the <ejb-ref-name> tag of the corresponding EJB reference in the ejb-jar.xmldeployment descriptor of the referencing enterprise bean.
If you look up enterprise beans from another J2EE application, in the application-j2ee-engine.xml of your EJB application you have to declare a reference to the referenced beans' application. For more information, see Editing Application References .