| |
INSTALLING THE JAVA PET
STORE 1.3_01 APPLICATION
This page describes how to set up and run Java Pet
Store 1.3_01 on an exteNd application server (version 4.0 or above).
Setting up the deployment environment
To set up your deployment environment, you:
- Create the required Pet Store databases
- Create the database connection pools
- Add the Pet Store users and groups
- Add the JMS topics and queues
Novell exteNd Workbench provides support for
Cloudscape and MySQL databases. A batch file has been provided for each
DBMS to perform all the above tasks in one step. If you want to use a different DBMS,
see the Sun Web site at http://java.sun.com/blueprints
for information.
To use the one-step setup process for Cloudscape
databases:
The Cloudscape setup file creates databases
using the Cloudscape DBMS provided with the application server.
-
Start the exteNd application server.
- Open a DOS prompt.
- Change to the Workbench Samples\Petstore1.3_01\setupFiles-cloudscape
directory.
- Enter the following: SetupPetstore appservername
For example, if you are running your application server on a local
server, enter:
SetupPetstore localhost
- The batch file creates the Cloudscape databases PetStoreDB, OPCDB,
and SupplierDB (in the server's db directory); connection pools for
the databases; users and groups needed by the application; and JMS
topics and queues needed by the application.
- If you need to perform one of these steps again later, you can directly invoke one of the following batch files in the same directory:
- CreateDatabases
- AddConnectionPools
- AddUsersGroups
- InitializeJMS
To use the one-step setup process for MySQL
databases:
MySQL databases
are only supported in Novell exteNd Application Server 5.0 or above and
require a download from the MySQL website.
- Download the database software from the MySQL website at http://www.mysql.com/downloads/mysql-3.23.html.
This software runs the database and is used by the setup files to create
the database tables.
- Download the MySQL Connector/J JDBC driver from the MySQL website
at http://www.mysql.com/downloads/api-jdbc.html.
This driver is used by the exteNd application server to manipulate
data using JDBC.
- Define a MYSQL_HOME environment variable that points to the the root
of the mysql install directory. For example:
SET MYSQL_HOME=c:\mysql
- Start the exteNd application server using the +cp:a switch to add
the MySQL Connector/J JDBC driver to your server classpath. For
example, if you placed the JAR in your SILVERSTREAM_HOME\lib directory,
start your server as follows:
silverserver +cp:a %SILVERSTREAM_HOME%\lib\mm.mysql-2.0.13-bin.jar
- Open a DOS prompt.
- Change to the Workbench Samples\Petstore1.3_01\setupFiles-mysql
directory.
- Enter the following: SetupPetstore appservername MySQLHostName
For example, if you are running your application server on a local server
and your MySQL database server is running on a machine named DBServerHost,
enter:
SetupPetstore localhost DBServerHost
- The batch file creates the MySQL databases PetStoreDB, OPCDB, and
SupplierDB (in the mysql install data directory); connection pools for
the databases; users and groups needed by the application; and JMS topics
and queues needed by the application.
- If you need to perform one of these steps again later, you can directly
invoke one of the following batch files in the same directory:
- CreateDatabases
- AddConnectionPools
- AddUsersGroups
- InitializeJMS
Deploying Java Pet Store
To deploy Java Pet Store, you:
Creating the server profile
A server profile provides Workbench with information
about the server to which you will deploy one or more Workbench projects.
You need to define only one server profile for the Java Pet Store application.
The same server profile is used to deploy all four project EARs.
To
create a server profile:
- Start Workbench.
- Select Edit>Profiles.
- Make sure the Servers tab is selected.
- Click New.
- Enter the following:
| Setting |
Value |
| Profile name |
Java Pet Store 1_3_01 |
| Server type |
SilverStream 4.0 or higher or Novell
5.0 |
| Deployment tools directory |
AppServerInstallDir\bin |
| Rapid Deployment directory |
Leave blank |
| Server name |
The name of your application server (such
as localhost) |
| Database name |
The name of your SilverMaster database (such
as SilverMaster50) |
- Click OK.
- Click OK to close the Profiles dialog.
Creating the deployment settings
The first time you deploy a project, you need to define
its deployment settings. For all subsequent deployments, you can simply
follow the deployment steps. For each of the four Pet Store EARs, you need to perform the following steps.
To
create deployment settings:
- Start Workbench.
- Select File>Open Project.
- Navigate to the Workbench Samples\Petstore1.3_01\projects-dbms
directory, where dbms is 'cloudscape' for Cloudscape
databases and 'mysql' for MySQL databases.
- Select the Pet Store project from the table below and click Open.
- Select Project>Deployment Settings.
- On the Server Profiles tab, choose the Java Pet Store profile you created
in the previous section.
- Select the Deployment Info tab.
- Navigate to the Samples\Petstore1.3_01\projects directory, then select
the deployment plan listed in the table for that project file.
- Click OK to save the deployment settings.
| Project file |
Deployment plan |
EAR name |
SilverCmd Flag (SilverStream 4.0 only) |
| petstore-ear.spf |
petstore-depl-plan.xml |
petstore.ear |
-l petstore_ear |
| supplier-ear.spf |
supplier-depl-plan.xml |
supplier.ear |
-l supplier_ear |
| opc-ear.spf |
opc-depl-plan.xml |
opc.ear |
-l opc_ear |
| petstoreadmin-ear.spf |
petstoreadmin-depl-plan.xml |
petstoreadmin.ear |
-l petstoreadmin_ear |
For example, to create the deployment settings for
petstore.ear:
- Start Workbench.
- Select File>Open Project.
- For Cloudscape, navigate to the Workbench Samples\Petstore1.3_01
\projects-cloudscape directory. For MySQL, navigate to the Workbench Samples\Petstore1.3_01
\projects-mysql directory.
- Select petstore-ear.spf.
- Select Project>Deployment settings.
- On the Server Profiles tab, choose the Java Pet Store profile you
created in the previous section.
- Select the Deployment Info tab.
- Specify Samples\Petstore1.3_01\projects-dbms\petstore-depl-plan.xml
as the deployment plan.
- If deploying against SilverStream 4.0 application server, you need
to specify the SilverCmd flag: -l petstore_ear
- Click OK to save the deployment settings.
Deployment steps
Once you have completed
the steps in Setting up the deployment
environment, you can deploy the application.
To
deploy the Java Pet Store EAR files to the exteNd application server:
- Make sure the exteNd application server is
running.
- Open Samples\Petstore1.3_01\projects-dbms\petstore-ear.spf
in Workbench.
- Select Project>Deploy Archive or click the Deploy icon.
- Check the Output Pane for status information about the deployment. The Output
Pane displays a Deployment completed message when the archive
has been successfully deployed to the server.
- Repeat the above steps to deploy supplier.ear,
opc.ear, and petstoreadmin.ear.
You can now run the Java Pet Store application.
Running Java Pet Store
To run Java Pet Store:
- Point your browser to appservername, where appservername
is the name of the server on which you deployed the application.
- Select its associated URL: petstore.
For example, to run Java Pet Store running on the localhost server, access
the URL http://localhost/petstore.
|