WebSphere Application Server Network Deployment, Version 6.0.x   Operating Systems: AIX, HP-UX, Linux, Solaris, Windows
             [TIP: Focusing the table of contents and search results]

Creating or changing a resource reference

A resource reference supports application access to a resource (such as a data source, URL, or mail provider) using a logical name rather than the actual name in the run-time environment. This capability eliminates the necessity to alter application code when you change the resource run-time configurations.

Before you begin

This topic guides you through updating the resource references of an enterprise application that you assembled previously. The topic Assembling applications details the assembly procedure.

About this task

Resource references are declared in the deployment descriptor by the application provider. At some point in the application deployment process, you must bind the resource reference to the actual name of the resource in the run time environment.

This topic describes how to update the resource references of an enterprise application using an assembly tool.

Procedure

  1. Import the enterprise application (EAR file) that you want to change into the EJB project.
  2. Start an assembly tool.
  3. If you have not done so already, configure the assembly tool for work on J2EE modules.
  4. Display the resource references for the type of module:
    • If an enterprise bean uses the resource reference:
      1. Expand the name of the EAR file.
      2. Expand EJB Modules.
      3. Expand the EJB module wanted.
      4. Expand the section for the appropriate type of enterprise bean (Session Beans or Entity Beans).
      5. Expand the enterprise bean.
    • If a servlet uses the resource reference:
      1. Expand the name of the EAR file.
      2. Expand Web Modules.
      3. Expand the Web module wanted.
    • If an application client uses the resource reference:
      1. Expand the name of the EAR file.
      2. Expand Application Clients.
      3. Expand the application client module wanted.
  5. Right-click the module whose resource references you want to change and click Open With > Deployment Descriptor Editor.
  6. For servlets and application clients, click Add. For EJB modules, select the particular bean and click Add.
  7. Select the resource reference option and click Next.
  8. Specify the settings and click Finish.
  9. Optional: Select the References tab and, under WebSphere Extensions, select an isolation level. If you choose to forego this step, the isolation level defaults to TRANSACTION_NONE.
  10. Optional: Under WebSphere Bindings, specify a JNDI name. If you choose to forego this step you can set (or override) the binding when the application is deployed.
  11. Close the deployment descriptor editor and save your changes.

Results

Files for the updated module are shown in the Project Explorer view.

What to do next

Verify the contents of the updated enterprise application in the Project Explorer view. Then, deploy your enterprise application.

You can generate EJB deployment code and deploy an EJB module to a target server in one step. In the Project Explorer view, right-click on the EJB project and click Deploy. See also the article Deploying EJB modules .




Related concepts
Data sources
Data source lookups for enterprise beans and Web modules
Related reference
Map resource references to resources
Data access: Resources for learning
Task topic    

Terms of Use | Feedback

Last updated: Mar 8, 2007 8:14:28 PM CST
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/tatk_crtresref.html

© Copyright IBM Corporation 2002, 2006. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)