Deploying a Web project that uses WebSphere Data Objects (WDO)

You can deploy a Web project that uses WebSphere Data Objects (WDO) for data access to a WebSphere Application Server V5.1 in two ways: by using Agent Controller or by using the Administrative Console. Both methods are explained below, using the Faces Classifieds sample as an example.

Important:

Use Agent Controller

Install the IBM Agent Controller on your server machine before you begin. See the appropriate documentation for installation information.

  1. Correct any server-side paths.

    1. In the Project Explorer, double-click details.jsp to open it in Page Designer.

    2. In the Page Data view, configure disp_ad. On the Connections tab, choose to edit the runtime connection.

      • If you are using a Cloudscape database, update the Class Location and Database Location to reflect the paths on your server machine. You can use variables setup in your server. For example, the path ${CLOUDSCAPE_JDBC_DRIVER_PATH}\db2j.jar points to the Cloudscape driver included with WebSphere Application Server. The path ${APP_INSTALL_ROOT}\localhost\DefaultEAR.ear\classifieds.war\CloudscapeSampleData\database points to your database, where your EAR project retains the default name of DefaultEAR and your Web project is named classifieds.

      • For databases other than Cloudscape, update the Class Location.

  2. Right-click your project in the Project Explorer and select Run > Run On Server to deploy your application.

    Note: Select WebSphere Application Server V5.1 (or higher), not the V5.1 Unit Test Server.

For updated information on Agent Controller, refer to the Read Me document on the Agent Controller installation disk.

Use the Administrative console

  1. Click File > Export > Ear file to export your application to an EAR file.

  2. In a browser, navigate to your server's Admin console and log in. By default, the URL is http://servername.domain:9090/admin/

  3. Add the JDBC Datasource.

    1. Select Resources > JDBCProviders; change to Server scope.

    2. Click New to create a new JDBC Provider. For the classifieds sample, enter the following values:
      Name = WDO Cloudscape JDBC Provider 
      
      Classpath = ${CLOUDSCAPE_JDBC_DRIVER_PATH}\db2j.jar Implemenation 
      
      Classname = com.ibm.db2j.jdbc.DB2jConnectionPoolDataSource

    3. Click Apply to commit this change. An Additional Properties section at the bottom of the page is displayed.

    4. Select Data Sources. Click New to add a new Data Source. For the classifieds sample, enter the following values:
      Name = MyConnection1 
      
      JNDI Name = jdbc/MyConnection1 
      
      Datasource Helper Classname = com.ibm.websphere.rsadapter.CloudscapeDataStoreHelper

    5. Click Apply to commit this change. An Additional Properties section at the bottom of the page is displayed.

    6. Select Custom Properties. Select the databaseName property to edit it.

    7. Set the Value field to the path to your database on your remote server. Because the database is part of the classifieds sample application, you can enter: ${APP_INSTALL_ROOT}\localhost\DefaultEAR.ear\classifieds.war\CloudscapeSampleData\database

    8. Click OK to commit the changes.

  4. Install your application.

    1. Select Applications > Install New Application.

    2. Click Browse next to the Local path: text file and select your exported EAR file.

    3. Click Next on the first 3 pages. Next through the rest of the pages taking the defaults. Press the

    4. On the Step 2: Map resource reference to resources page, map the DataSource to the Myconnection1 Resource Reference in your classifieds module.

    5. Accept the rest of the defaults.

  5. Create shared library.

    1. Select Environment > Shared libraries.

    2. Click New.

    3. Enter the following:
      Name = WDO Relational Mediator Shared Library
      
      Classpath = ${WAS_INSTALL_ROOT}/optionalLibraries/WDO/wdo-interface.jar
      
      ${WAS_INSTALL_ROOT}/optionalLibraries/WDO/emf-runtime.jar
      
      ${WAS_INSTALL_ROOT}/optionalLibraries/WDO/emf-event.jar
      
      ${WAS_INSTALL_ROOT}/optionalLibraries/WDO/jdbcmediator.jar
      
      ${WAS_INSTALL_ROOT}/optionalLibraries/WDO/wdo.jar
      
      ${WAS_INSTALL_ROOT}/optionalLibraries/WDO/wdo.xmlmediator.jar

    4. Click OK to commit the changes.

  6. Update EAR properties.

    1. Select Applications > Enterprise Applications and select your EAR file.

    2. Switch your Applications Classloader Mode to PARENT_LAST.

    3. Select Libraries from the Additional Properties section at the bottom of the page.

    4. Click Add.

    5. Select your Shared Library.

    6. Click OK to commit the change.

  7. Click Save to save your changes.

 

Related concepts

Data access for Faces components
WDO data access

 

Related tasks

Using Faces components- overview
Creating a dynamic Web project