Adding resource environment references (J2EE 1.4)

The J2EE specification provides a means for J2EE application components to refer to administered objects that are associated with a resource. The reference is done by using "logical" names called resource environment references. You can use the deployment descriptor editors to define resource environment references.

About this task

At deployment, the resource environment references are bound to the actual administered objects in the target operational environment.

For each resource environment reference that you define, a resourece-env-ref element is added to the deployment descriptor for that application component. Resource environment references are scoped to the application component where they are defined, so they are not accessible to other application components during run time. Other components can define resource environment references with the same name without causing a name conflict.

Resource environment references are available only for J2EE 1.3 or later, and EJB 2.x.

To define a resource environment reference, complete the following steps:

Procedure

  1. Open the Add Reference wizard from the deployment descriptor editor for your J2EE module.
  2. Select Resource environment reference and click Next.
  3. In the Name field, specify a name for the reference. The value entered in the Name field is used in the resource-env-ref-name entry in the deployment descriptor. The name is the environment entry name that is used in the application code.
    Note: The name of the reference is relative to the java:comp/env context. For example, the name should be jms/StockHistoryDB rather than java:comp/env/jms/StockHistoryDB.
  4. In the Type field, select the expected type of the referenced object. The value entered in this field is used in the resource-env-ref-type entry in the deployment descriptor.
  5. In the Description text area, enter a description for the reference. Click Finish.

Feedback