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:
- It is critical that you follow one of these procedures before deploying a Web application that uses WDO; if you do not, you might interfere with the Admin. console on the server.
- The following procedures should not be used for Web projects that use SDO (e.g. applications that are to be deployed on WebSphere Application Server V6.0 or later.)
Use Agent Controller
Install the IBM Agent Controller on your server machine before you begin. See the appropriate documentation for installation information.
- Correct any server-side paths.
- In the Project Explorer, double-click details.jsp to open it in Page Designer.
- 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.
- 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
- Click File > Export > Ear file to export your application to an EAR file.
- In a browser, navigate to your server's Admin console and log in. By default, the URL is http://servername.domain:9090/admin/
- Add the JDBC Datasource.
- Select Resources > JDBCProviders; change to Server scope.
- 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- Click Apply to commit this change. An Additional Properties section at the bottom of the page is displayed.
- 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- Click Apply to commit this change. An Additional Properties section at the bottom of the page is displayed.
- Select Custom Properties. Select the databaseName property to edit it.
- 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
- Click OK to commit the changes.
- Install your application.
- Select Applications > Install New Application.
- Click Browse next to the Local path: text file and select your exported EAR file.
- Click Next on the first 3 pages. Next through the rest of the pages taking the defaults. Press the
- On the Step 2: Map resource reference to resources page, map the DataSource to the Myconnection1 Resource Reference in your classifieds module.
- Accept the rest of the defaults.
- Create shared library.
- Select Environment > Shared libraries.
- Click New.
- 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- Click OK to commit the changes.
- Update EAR properties.
- Select Applications > Enterprise Applications and select your EAR file.
- Switch your Applications Classloader Mode to PARENT_LAST.
- Select Libraries from the Additional Properties section at the bottom of the page.
- Click Add.
- Select your Shared Library.
- Click OK to commit the change.
- 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