PlantsByWebSphere Ajax Edition for CEA on WebSphere Application Server 7.0
Configuring the Database Resources Required by PlantsByWebSphere Ajax Edition for CEA
The PlantsByWebSphere Ajax Edition for CEA application uses the Derby database included with WebSphere Application Server. The PlantsByWebSphere.ear file contains a set of embedded Derby database tables that are used by the application. Configuring the database connection involves defining a Derby Java Database Connectivity (JDBC) XA-provider (unless one already exists), and defining a data source for PlantsByWebSphere Ajax Edition for CEA.
Define a Derby JDBC XA Provider
Follow the procedures outlined below to define a Derby JDBC XA provider. A JDBC provider supplies the specific JDBC driver implementation class for access to a specific vendor database.
- Start WebSphere Application Server if it is not running.
- Launch the administrative console.
- Select Resources > JDBC > JDBC Providers in the left-hand navigation tree of the administrative console.
- Set the scope to Node=<Node Name>,server=<Server Name>.
- Click New.
- Specify the following properties:
- Database type: Derby
- Provider type: Derby JDBC Provider
- Implementation type: XA Data source
- Name: Derby Provider for PlantsByWebSphereAjax (XA)
- Click Next.
- On the summary page, click Finish to save the changes to the local configuration.
- Click Save to save the changes directly to the master configuration.
Define a Data Source
Follow the procedures outlined below to define a data source and associate it with the Derby JDBC XA provider.
- Start WebSphere Application Server if it is not running.
- Launch the administrative console.
- Click Resources > JDBC > Data sources in the left-hand navigation tree of the administrative console.
- Set the scope to Node=<Node Name>,server=<Server Name>.
- Click New.
- Specify the following properties:
- Data source: PLANTSDB
- JNDI name: jdbc/PlantsByWebSphereAjaxDataSource
- Click Next.
- Choose Select an existing JDBC Provider.
- Choose Derby Provider for PlantsByWebSphereAjax (XA) (defined earlier).
- Click Next.
- For the Database name, enter (exactly) ${APP_INSTALL_ROOT}/${CELL}/PlantsByWebSphereAjax.ear/Database/PLANTSDB
The string ${APP_INSTALL_ROOT}/${CELL} is a WebSphere environment variable and must be entered exactly as written above. (Do not substitute the actual install root and cell name.)
- Choose Use this data source in container managed persistence (CMP).
- On the remaining settings pages, accept the default values and click Next.
- On the summary page, click Finish to save the changes to the local configuration.
- Click Save to save the changes to the master configuration.
Installing PlantsByWebSphere Ajax Edition for CEA
Before You Begin
The PlantsByWebSphere Ajax Edition for CEA application is an undeployed Java Enterprise Archive file (EAR); therefore, the deployment bindings between the Enterprise Java Beans (EJB) and the application server have not been generated. You can generate the bindings with the deployment tool that is provided with WebSphere Application Server. The deployment tool generates an EAR file that contains generated binding code. The newly generated EAR file can then be installed to WebSphere Application Server.
First open a command window for your platform and change to the directory that contains the PlantsByWebSphere EAR file:
Linux, UNIX, and z/OS
- <app_server_root>/feature_packs/cea/samples/plantsbywebsphere/PlantsByWebSphere.ear
Windows
- <app_server_root>\feature_packs\cea\samples\plantsbywebsphere\PlantsByWebSphere.ear
Then submit the following command:
Linux, UNIX, and z/OS
<app_server_root>/bin/ejbdeploy.sh PlantsByWebSphere.ear <working directory> PlantsByWebSphere_Deployed.ear -dbvendor DERBY_V10
Windows
<app_server_root>\bin\ejbdeploy.bat PlantsByWebSphere.ear <working directory> PlantsByWebSphere_Deployed.ear -dbvendor DERBY_V10
The <working directory> is a temporary location that the ejbdeploy tool can use for storage. For example,
on Windows, a temporary location could be the c:/temp directory.
|
Procedure
- Start WebSphere Application Server if it is not running.
- Launch the administrative console.
- Click Applications > New Application in the left-hand navigation tree of the administrative console.
- Click New Enterprise Application.
- Specify the path to the PlantsByWebSphere_Deployed.ear file created above.
- Click Next
- Select the Fast Path option.
- Click Next.
- On the remaining settings pages, accept the default values and click Next.
- On the summary page, click Finish to save the changes to the local configuration.
- After the application is installed, click Save to save the changes to the master configuration.
- To start the application, click Applications > Application Types > WebSphere enterprise applications in the left-hand navigation tree of the administrative console. Then select the PlantsByWebSphereAjax application and click Start.
Accessing PlantsByWebSphere AJAX Edition for CEA
The URL for the application is http://host:port/PlantsByWebSphereAjax, for example, http://localhost:9080/PlantsByWebSphereAjax.
The example assumes that the application server is running locally, and that the internal HTTP server is using port 9080. The port can be different depending on how you installed the application server. To determine the HTTP port, first click Servers > Server Types > WebSphere application servers in the left-hand navigation tree of the administrative console. Next, click the appropriate entry in the list of application servers. Finally, click Ports (located within the Communications category of settings) to see a list of currently configured ports for the application server. The HTTP port is the WC_defaulthost entry.