|
|
Run 2001 J2EETM
Deployathon Online!
With Oracle9iAS Containers for J2EETM 1.0.2.2
Step 1:
Download and Install JavaTM 2 SDK, Standard Edition
Step 2:
Download OC4J
Step 3: Install
and Configure OC4J
Step 4: Download
the Java Pet Store Application
Step 5: Install
and Configure the Java Pet Store Application
Step 6: Run
the Java Pet Store Application with an Oracle Database
Notes
Support
Step 1: Download and Install
Java 2 SDK, Standard Edition
Oracle9iAS Containers for J2EE
1.0.2.2, requires Java 2 SDK, Standard Edition v1.3.0_02 or v1.2.2_07 for more
details, check certification
matrix . If Java 2, Standard Edition v1.3.0_02 or v1.2.2_07 is not already
installed on your platform, you need to install it now, from http://java.sun.com/j2se.
Step 2: Download Oracle9iAS
Containers for J2EE (OC4J)
Download the latest OC4J
from OC4J download page on OTN
Step 3: Install and Configure
OC4J
To install the server and set
the administrative password:
- unzip oc4j.zip
- change to <oc4j-home>
directory (<path-to-j2ee>/home)
- java -jar orion.jar
-install
- follow the instructions
provided by the installation program.
Step 4: Download the Java
Pet Store Application
You can download the latest
Java Pet Store Application (version 1.1.2) from the JavaTM
Pet Store 1.1.2 Release page
Step 5: Install and Configure
the Java Pet Store Application
- Set the environment
variable JAVA_HOME to the base directory where you installed the Java 2 SDK.
For example, set JAVA_HOME to ~/jdk1.3.0_02 or ~/jdk1.2.2_07
- Configure OC4J
DataSource for an Oracle database
- Copy PetStore_data_source
into <oc4j-home>/config/data-sources.xml
- or alternatively add
PetStore_data_Sources entries to
<oc4j-home>/config/data_sources.xml
- Create user estoreuser
with password estore
- Grant connect, resource
and create session privileges to estoreuser
- Unzip the downloaded
application in a directory of your choice (<petstore-home>)
- Configure the PetStore
Application to work with an Oracle database
- Change to the directory
that contains the expanded PetStore application (<petstore-home>)
- In order to enable
Data Access Objects to work against an Oracle database instead of Cloudspace
(the default), in <petstore_home>/src/components/customer/src/customer_ejb.xml,
replace OrderDAOCS with OrderDAOOracle
- In order to work around
a PetStore Application bug which faults PetStore errorpage to throw a "PrintWriter
class Not Found Exception", add the following statement to <petstore-home>/src/petstore/src/docroot/errorpage.jsp
<%@ page import
="java.io.*" isErrorPage="true" %>
- Update the Application
Server Type
- in <petstore-home>/src/petstore/src/docroot/WEB-INF/web.xml
<env-entry>
<description>no
description</description>
<env-entry-name>server/ServerType</env-entry-name>
<env-entry-value>Java
2 Enterprise Edition Reference Implementation</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
replace "Java 2 Enterprise Edition Reference Implementation" with "Oracle9iAS
Containers for J2EE"
- Deploy the PetStore
Application on OC4J Server
- Copy petstore.ear
from the <petstore-home>/src/petstore/build/ into <oc4j-home>/applications/
- In <oc4j-home>/config/server.xml,
uncomment application entries and add the petstore entry as follows:
<application name="petstore" path="../applications/petstore.ear" />
- In <oc4j-home>/config/default-web-site.xml,
uncomment web-app entries and add the petstore entry as follows:
<web-app application="petstore" name="petstore" root="/technology/petstore" />
java -jar orion.jar
or
java -jar orion.jar -config <oc4j-home>/config/server.xml
"Oracle9iAS Containers for J2EE 1.0.2.2 - Up and running"
Step 6: Run the Java Pet
Store Application
- Open your Web browser.
- Specify the URL: http://localhost:8888/pestore
- Follow the instructions
provided by the petstore application to load java Pet Store database tables
Notes
- You do not have to access
the Java Pet Store application to check that the Oracle9iAS Containers for
J2EE server is running. Simply point your browser to http://hostname:port,
where hostname is the host on which the OC4J server is running,
and port is the default port number to which the OC4J server is listening.
For example, point to: http://localhost:8888
- The instructions for
deploying PetStore in step 5 assume local deployment, in order to deploy to
a remote OC4J instance use the fololowing command:
java -jar admin.jar ormi://localhost
<admin> <admin-pasword> -deploy -file petstore.ear -deploymentName petstore
- To shut down OC4J, gracefully,
issue the following command, from <oc4j-home> directory:
% java -jar admin.jar
ormi://localhost/ <admin> <admin-password> -shutdown
If it does not shut down
the container, force a rapid shut down by passing the force argument, as follows:
% java -jar admin.jar
ormi://localhost/ <admin> <admin-password> -shutdown force
For the unlikely situation
where none of these work, kill OC4J process(es) with your operating system command
- Note: OC4J release 1.0.2.2
is pre-configured with thin JDBC driver for Oracle8.0, Oracle8i databases;
to run OC4J against an Oracle9i database, replace classes12.jar in <oc4j-home>/lib/
with the one shipped with Oracle9i DB
- You can run the PetStore
with OC4J using a database other than Oracle8i. If
you would like to use another database with OC4J, please check the "Using
Merant Drivers" section in Using
OC4J
Support
- For questions related
to running the Deployathon on Oracle9iAS Containers for J2EE, Please see the
Oracle9iAS
J2EE.
- The J2EEblueprints interest
list is the place to get answers to generic questions about the Deployathon.
To join the interest list, send an email to listserv@java.sun.com. Specify
subscribe j2eeblueprints-interest yourlastname yourfirstname in the body of
the email.
Back to Top
Introduction
|