Installing
the OC4J JSP SamplesThis document presents following topics: Required
SoftwareFollowing software are required for the installation.
- Oracle9i Database
- OC4J (release 9.0.3 or later) downloadable
from OTN.
- OTN
Travel Schema downloadable from OTN
Travel Schema Page
- Oracle XDK(XML Developer's Kit) for Java downloadable
from OTN.
Note: OTN OC4J JSP Samples have been certified with
Red Hat Linux Advanced Server 2.1, Solaris 5.6 and Windows NT
4.0, 2000. Extracting the Source Files
The application files are stored in an archive named OjspSamples.jar.
Download the archive and extract it to a convenient directory. Execute
following command to extract the files:
jar
xvf OjspSamples.jar The
archive OjspSamples.jar extracts the files that include
the OC4J Jsp Samples. All the files are extracted into the -OjspSamples- directory.
This directory will have the following files mentioned in the table below.
| File | Description |
| ojspsamples.ear |
Enterprise ARchive(EAR) file which holds all the OC4J Jsp samples ready for
deployment on OC4J 2.0 | | CIS.dmp | Database
dump file which contains the tables and sample data required for the Country Information
Sample. | | Install.html |
This File. | | Readme*.html | Readme
Files. | | oracle9i.gif | Logo
used in the Readme.html file. | | blaf.css |
Stylesheet used in this Install and Readme files. |
Configuring the Samples
Setting up XML-SQL Utility JAR filesSome of the samples which are
packaged in the EAR file extracted above use the XML-SQL Utility classes. To setup
the required XML-SQL Utility jars with OC4J, please perform the following two
steps:
Step
1: Extract the XDK for Java utility downloaded earlier(refer to
required software
section) to a local directory say C:\xdk on Windows or /home/xdk on Unix or Linux.
Step 2: Copy the xsu12.jar archive
file from the C:\xdk\lib or /home/xdk/lib directory to the OC4J_HOME\j2ee\home\lib
directory. Then, restart the OC4J server.
Setting
Up the Travel SchemaStep 1: Most
of the OC4J Jsp samples which are packaged in the EAR file extracted above use
the OTN Travel Schema. Please download and import the Travel schema into your
Oracle 9i database using the instructions at OTN
Travel Schema Page. Step 2: Goto
the \j2ee\home\config directory of your OC4J installation. Edit the "data-sources.xml"
file in this directory and add the following two entries within the <data-sources>...</data-sources>
tags : <data-source class="oracle.jdbc.pool.OracleDataSource"
name="OTN9iDS" location="jdbc/OTN9iDS" pooled-location="jdbc/PooledOTN9iDS"
connection-driver="oracle.jdbc.driver.OracleDriver" username="travel"
password="travel" url="jdbc:oracle:thin:@hostname:port:sid"
inactivity-timeout="300" min-connections="3" max-connections="50"
wait-timeout="10" /> <data-source class="oracle.jdbc.pool.OracleConnectionPoolDataSource"
name="ConnPooledOTN9iDS" location="jdbc/ConnPooledOTN9iDS" connection-driver="oracle.jdbc.driver.OracleDriver"
username="travel" password="travel" url="jdbc:oracle:thin:@hostname:port:sid"
inactivity-timeout="300" /> where, hostname
=> is the hostname of the machine where your Oracle 9i Database is installed
port => is the port on which the 9i Database
listener is running on sid => is the
Database sid. Please change the hostname,port and sid
values to reflect the details of your database. Note:
The location "jdbc/OTN9iDS" and "jdbc/PooledOTN9iDS" values are used by the samples and
hence please do not change them. Save the data-sources.xml
file. After saving the file, re-start the OC4J server so that the above data-source
entries take effect. Setting Up the Travel
Schema with Country InformationThe Country Information System sample needs
the tables in the CIS.dmp file extracted above. For running the sample successfully,
import this dump file into the Travel Schema created above. The dump can be imported
using the import utiliy that is supplied with Oracle9i Database. The import command
line utility executable "imp" can be found under the %ORACLE_HOME%\bin directory
where ORACLE_HOME is the path under which the Oracle9i database is installed.
For importing the tables, run the following command from the %ORACLE_HOME%\bin
directory: cmd> imp travel/travel@<connect_str>
file=<path>\CIS.dmp ignore=n full=y log=cis.log
where, <connect_str> =>
is a valid entry in tnsnames.ora connecting to the travel user in your database.
<path> => is the path of the OjspSamples
directory where the dump file exists. After importing the Country Information
tables, you can deploy the samples on OC4J using the steps below.
Deploying the Samples on stand-alone OC4J 1.
Go to the “OjspSamples” directory created above. 2.
Move the ojspsamples.ear file to \j2ee\home\applications directory of your OC4J installation. 3.
Go to OC4J_HOME\j2ee\home\config directory
4.
Edit http-web-site.xml file.
5.
Add the following entry within the <web-site> tags : <web-app
application="ojspsamples" name="ojspsamples-web" root="/technology/ojspsamples"/>
6.
Save this file
7.
Open server.xml file in the OC4J_HOME\j2ee\home\config
directory and add the following entry within the <application-server> tag.
<application
name="ojspsamples" path="../applications/ojspsamples.ear" />
8.
OC4J's hot-deploy feature will automatically auto-deploy and install the
application for you if the server is running already. If the server is not running,
please start the server and it will deploy the application automatically at start-up.
9.
Then, access the samples home page using the URL : http://<oc4jserver>:<port-no>/ojspsamples/
where,
<oc4jserver> - is the hostname / ip-address of the machine where OC4J is
installed. <port-no> - is the port number on which oc4j server is listening.
Default port is 8888.
|