An EJB reference is a logical name used to locate the home interface of an enterprise bean used by an application.
At deployment, the EJB reference is bound to the enterprise bean's home in the target operational environment. The container makes the application's EJB references available in a JNDI naming context. It is recommended that references to enterprise beans be organized in the ejb subcontext of the application's environment (in java:comp/env/ejb).
For example, if ejb/EmplRecord is specified, the referring code looks up the enterprise bean's home interface at java:comp/env/ejb/EmplRecord. This JNDI name is an alias used by the code (the actual JNDI name is specified on the Binding tab).
The target enterprise bean can be in any EJB module in the same J2EE application as the referring module. To avoid having to rename enterprise beans to have unique names within an J2EE application, specify the path name of the EJB archive file that contains the referenced enterprise bean and append the target bean's name, separated by a # symbol (for example, ...products/product.jar#ProductEJB). The path name is relative to the referring module's archive file specification. If a link is not specified, the reference must be resolved to a JNDI name during installation.
Data type | String |
Default | None; must be set |
Range | Entity or Session |
For EJB references, the value of this setting must match the JNDI name of the enterprise bean as it was specified on the Binding tab for the EJB module that contains the bean.