This document describes how to install and configure the Java Pet
Store sample application on Windows NT, Windows 2000, and Windows
98. Please be sure to follow the instructions closely.
- Install Java Standard and Enterprise SDKs.
If you don't already have them, download and install each of the following:
- Configure Java home directory environment
variable.
In your autoexec.bat file
(on Windows 98), or in your Windows Environment settings (under
My Computer/Properties/Advanced/Environment
Variables... in NT and 2000), set JAVA_HOME to
the base directory where you installed the J2SE SDK. For
example, if you installed the J2SE SDK in C:\jdk1.3, set
JAVA_HOME to C:\jdk1.3 .
In Windows 98, the line in autoexec.bat would be:
set JAVA_HOME=C:\jdk1.3
- Configure J2EE home directory environment
variable.
In the same manner as in the previous
step, set the environment variable J2EE_HOME to the
base directory of the J2EE SDK. For example, if you installed
the J2EE SDK at C:\j2sdkee1.2.1 , set
J2EE_HOME to C:\j2sdkee1.2.1 . In
Windows 98, the autoexec.bat line would be:
set J2EE_HOME=C:\j2sdkee1.2.1
On Windows 98 only: Extend the environment space by
placing the following line in your CONFIG.SYS file
(usually in C:\CONFIG.SYS ):
SHELL C:\COMMAND.COM /E:8192 /P
After setting these environment variables, be sure to set them in
your command interpreter by restarting Windows.
- Start the Cloudscape database server.
This command will run the Cloudscape server, so your command prompt
will not return. You'll want to run this command in a
separate window. Change directory to $J2EE_HOME/bin and run:
cloudscape -start
You will probably see some error messages that look like:
ERROR 42X05: Table 'LINEITEM' does not exist.
These messages can safely be ignored: they're simply table
drop statements for future invocations of this script. Since no
tables exist in an empty database, they fail (harmlessly) the first
time this script is run.
- Unzip the Java Pet Store
Use your favorite ZIP decompression tool to unzip the Java Pet Store file
petstore.zip to a convenient directory. Everything in the
zip file will decompress to a directory called jps1.1 , referenced
in subsequent steps.
- Create the Java Pet Store database.
The top-level directory of the Java Pet Store
is jps1.1 .
Change directory to jps1.1/database.sql and run
startIJ cloudscape.sql
- Configure the J2EE SDK to use the Java TM Pet Store database.
Edit the file
$J2EE_HOME/config/default.properties , and append
to the jdbc.datasources property the following text:
|jdbc/EstoreDB|jdbc:cloudscape:rmi:CloudscapeDB;create=true|
jdbc/InventoryDB|jdbc:cloudscape:rmi:CloudscapeDB;create=true .
Be sure the variable and its value appear on a single
line, not broken in two pieces as shown here.
- Enable creation of new Java Pet Store users.
Edit the file $J2EE_HOME/lib/security/server.policy , and append
the following line to the very last grant section of the file:
permission java.io.FilePermission "<<ALL FILES>>", "read,write,delete";
- Start the J2EE server.
This command runs the J2EE server, so your command prompt will not return.
You'll want to run this command in a separate window.
Change directory to $J2EE_HOME/bin and run:
j2ee
For copious debugging output, run:
j2ee -verbose
- Start the deploy tool.
Still in the $J2EE_HOME/bin directory, run:
deploytool
- Deploy the application.
Click on the File menu, click on Open
Application... menu item, and select the file
jps1.1/petstore.ear . Then, click on Tools
menu, click Deploy Application, and go through the
dialog boxes to complete the deployment. You can choose to use
the default values, if you do not want to change any
settings.
- Visit the Java Pet Store
Open your Web browser to the site:
http://localhost:8000/estore/index.html
|