PlantsByWebSphere
on WebSphere® Application Server 6.0.2
Configure the
Database for PlantsByWebSphere
The PlantsByWebSphere application
uses the Cloudscape database which is provided by WebSphere® Application
Server. The PlantsByWebSphere.ear file contains a set of embedded
Cloudscape database tables that are used by the application. Configuring
the database connection involves creating a Cloudscape JavaTM Database
Connectivity (JDBC) XA-provider, if one has not already been created,
and defining a data source to the application.
Define
the Cloudscape XA Provider
- Start WebSphere Application Server and log into the administrative
console to define a Cloudscape XA Provider, if one is not already
defined.
- Select Resources > JDBC Providers in the left menu. The
JDBC provider encapsulates the implementation class for the specific
database provider. The default scope level should be Server.
- Select New button.
- For Step 1: select Cloudscape.
- For Step 2: select Cloudscape JDBC Provider.
- For Step 3: select XA DataSource.
- For Implementation type select XA Data source.
- Click Next.
- For Name type: "PlantsByWebSphereAjax Cloudscape JDBC Provider(XA)".
- Click Ok.
- Select Save to save directly to the master configuration.
The provider is configured. Next you create and associate
the PlantsByWebSphere data source with the new provider.
Define
and associate the Data source for the PlantsByWebSphere application
- Click Resources > JDBC Provider in the left menu.
- Select the "PlantsByWebSphereAjax Cloudscape JDBC Provider (XA)"
that you created in the previous step. You may already have a default
"Cloudscape JDBC Provider (XA)" which you can use as well.
- Click on Data Source link under Additional Properties in the right
column.
- Click New to create a new data source.
- For the Data source name, enter PlantsByWebSphereAjax Datasource.
- For the JNDI name, enter jdbc/PlantsByWebSphereAjaxDataSource.
- Mark the check box 'Use this data source in container managed
persitence (CMP)'. The check box might already be selected by
default.
- For the Database name, enter ${APP_INSTALL_ROOT}/${CELL}/PlantsByWebSphereAjax.ear/Database/PLANTSDB
The ${APP_INSTALL_ROOT}/${CELL} is
a WebSphere environment variable and should be entered as written.
- Click Ok.
- Click save to save to the master configuration.
Installing the PlantsByWebSphere application on WebSphere
Applications Server 6.0.2
Before
you begin:
Locate the PlantsByWebSphere
Enterprise Application Archive (EAR) file that was provided with this
documentation. Depending on how you obtained this sample application,
you can find the EAR file in one of two places:
- If you are reading these
instructions from within Eclipse Help because you installed this file
as an Eclipse feature, then you can locate the EAR file in the following
directory:
UNIX®-based: <ECLIPSE_HOME>/plugins/com.ibm.websphere.samples.plantsbywebsphere_plugin_1.4.0/samples/PlantsByWebSphere.ear
|
Linux®: <ECLIPSE_HOME>/plugins/com.ibm.websphere.samples.plantsbywebsphere_plugin_1.4.0/samples/PlantsByWebSphere.ear
|
Windows(TM): ECLIPSE_HOME>\plugins\com.ibm.websphere.samples.plantsbywebsphere_plugin_1.4.0\samples\PlantsByWebSphere.ear
|
- If you installed the IBM® WebSphere Application Server Feature
Pack for Web 2.0 using the installer, you will find the PlantsByWebSphere.ear
file at the following location:
UNIX-based or z/OS: <WAS_HOME>/web2fep/samples/PlantsByWebSphere/PlantsByWebSphere.ear |
Linux: <WAS_HOME>/web2fep/samples/PlantsByWebSphere/PlantsByWebSphere.ear |
Windows: <WAS_HOME>\web2fep\samples\PlantsByWebSphere\PlantsByWebSphere.ear
|
The Plants By WebSphere application is an undeployed Java
Enterprise Archive file (EAR). This means that the deployment bindings
between the Enterprise JavaBeans (EJB) and the application server
are not generated yet. To generate the bindings, run 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.
Open a command window for your platform and type the
following command. This assumes the Windows platform, but the method
is the same on other platforms.
ejbdeploy.[bat|sh] PlantsByWebSphere.ear <working directory> PlantsByWebSphere_deployed.ear -dbvendor CLOUDSCAPE_V5
The ejbdeploy tool is located in the bin directory of where you installed WebSphere Application Server 6.0
The <working directory> is a temporary location that the ejbdeploy tool can use for storage. As an example, on Windows a
temporary location could be the c:/temp directory. |
- Start the WebSphere Application Server, go to the administrative
console and log in with your user ID and password. Click Applications
> Install New Application in the left menu.
- For the path to the new application, click Browse and locate
the PlantsByWebSphere_deployed.ear file. You created this file in
the previous step.
- Click install.
- Proceed through the install accepting the defaults.
- Click Finsh.
- Click save to save to the master configuration after the
application is installed.
Accessing PlantsByWebSphere : AJAX Edition
- To start the application afer installation, Select Applications
--> Enterprise Applications in the left menu.
- Select the PlantsByWebSphereAjax application checkbox,
followed by clicking Start.
The URL for the application is http://localhost:9080/PlantsByWebSphereAjax
This
information assumes that the internal HTTP server is running on port
9080. The port can be different depending on how you installed the
application server. You can locate the HTTP port by clicking Servers
> Application Servers in the left menu. Select the application
server from the list. On the Application Servers property window,
click ports to see a list of currently configured ports for
the server. The HTTP port is the WC_defaulthost entry.