Oracle9iAS Web Cache Sample - Personalized Portal

This document is organized into following sub-sections : Install instructions are documented here in this document as well as in the Viewlets, user can follow either of it to install this sample.

Required Software

  • Oracle9iAS Release 2 v9.0.2  (UNIX users need to apply JSP patch mentioned below) (or)
  • Oracle9iAS Web Cache 9.0.2 or higher (Not needed if you have Oracle9iAS Release 2)

  • Oracle9iAS Containers for J2EE (OC4J) Version 9.0.2.0.0 or higher
    9.0.2 users on Unix platform, please ensure to apply the JSP Patch::2383213 from http://metalink.oracle.com. (This patch willl be included in 9.0.3 release).
  • Oracle9i v9.0.2 or above JDBC Drivers for use with JDK 1.3.x & 1.2.x ( Note: Oracle9i v9.0.2 JDBC compliant drivers can be downloaded from /software/index.html )  In case of Oracle9i JDeveloper this driver is included as part of the product.
  • Oracle9i v9.0.2 or higher Client installation.( Note: The Client installation is not required if the database is installed on your machine or you have easy access to the machine where database is installed. )
  • Oracle9i v9.0.2 (Database) or higher running SQL*Net TCP/IP listener.
  • Oracle9i JDeveloper or higher (Optional) ( Note: JDeveloper is Oracle's Visual Java Development environment and can be downloaded from location /products/jdev/index.html )

Extracting the sample

The sample is provided as a .jar file. Download and extract the MyPortal.jar file.

jar -xvf MyPortal.jar

Extraction of the jar file results in the creation of 'MyPortal' directory and 4 sub-directories within it.
 
 
doc This folder contains all the documentation related to know and run this application
code This folder contains the java beans used by the JSPs in this application
public_html This folder contains the JavaSever Pages files and other html files used by this application
other This folder contains the sql file needed for running this application

Installation Steps

Database Setup

Viewlet of Database Setup

Follow the steps given below to setup the database.

Step 1:. Connect to the database that you would be using. For example, you can connect to scott/tiger or any other user. To create your own user, say 'portaldemo' user, follow the below mentioned steps :

SQL> Connect system/manager
SQL> Grant connect, resource to portaldemo identified by portaldemo;
SQL> connect portaldemo/portaldemo

Step 2:. Run tables.sql from <base>\MyPortal\other directory to create tables and data required by the system, where <base> is the directory where you have extracted this sample application..

Step 3:.Edit the file MyPortal.properties  in <base>\MyPortal\code\ directory . This java file contains database specific parameters, Oracle9iAS, Oracle9iAS Web Cache specific parameters and some application specific parameters. Change these values of the variables in this file, to reflect your environment.

Note : For DHCP users

    Those who have configured DHCP should ensure that they use the IP address allocated to their machine. This can be found by using the ipconfig command to determine the IP address.

The List of configruable parameters in the MyPortal.properties are :- (This property file should be changed accordingly to reflect user's environment).
 
Parameter Description
Database Specific Parameters
Database.hostName Machine name on which the Oracle9i database is installed
Database.portNumber Port number on which the database listens.
Database.sid SID of the database.
Database.userName Username on which the tables have been created.
Database.password Password for the user.
Oracle9iAS Web Cache Specific Parameters
Webcache.hostName Machine name/IPAddress on which Oracle9iAS Web Cache is installed. expects http:// as prefix to the machine name.
Webcache.listenPort  Port on which Oracle9iAS Web Cache is made to listen to OC4J.
Webcache.invalidationPort  Port on which Oracle9iAS Web Cache listens for invalidation messages.
Webcache.administrationPort Port on which Oracle9iAS Web Cache Admin tool is running.
Webcache.invalidationPassword Oracle9iAS Web Cache invalidation password.
Oracle9iAS Specific Parameters
ApplicationServer.hostName  Machine name/IP Address on which OC4J is running. Please prefix "http://" to the machine name
ApplicaitonServer.listenPort Port on which OC4J listens to web requests
Proxy Server Details 
ProxyServer.hostName Machine name/IP Address of the proxy server, if any. If proxy server is not used, provide a blank value like ""
ProxyServer.portNumber  Port number of the proxy server, if any. If proxy server is not used, provide a blank value like "".

Deploying the application to OC4J from Oracle9i JDeveloper

Viewlet of Oracle9i JDeveloper Deployment

This section describes about deploying this application to the Oracle9i containers for J2EE (OC4J) from Oracle9i JDeveloper. If Oracle9i JDeveloper is not available the application can be deployed to OC4J manually. To see instructions on how to deploy this application manually, click here.

Step 1:. Open the MyPortal.jws in Oracle9i JDeveloper. The workspace will contain MyPortal.jpr (project file), JSP files and other files.

Step 2: Create an Application Server Connection by clicking on the Connections Node. Right click on  Application Servers and select "New Connection".  Provide the appropriate connection information of the Application Server to which the sample is to be deployed.

Step 3: Right Click MyPortal.deploy node and select "Deploy to <connection name>",  where the connection name is the name of the connection created in the previous step. This results in creation of war & ear files, followed by the deployment of this application to Oracle9iAS.
 

Deploying the application to OC4J manually


Viewlet of Manual Deployment

This section describes the steps required in deploying this application to the Oracle9i containers for J2EE (OC4J) manually. These instructions are not necessary, if the application has been deployed already.

Step 1:  SET Path and ClassPath

Ensure that <JAVA_HOME>\bin is in the PATH, where <JAVA_HOME> is the directory where the JDK is installed.

Make sure that classes12.zip or classes12.jar is in the CLASSPATH.

Step 2:  Execute the following Shell Script :

  • <base>\MyPortal\createwar.bat   in Windows Environment (or)
  • <base>\MyPortal\createwar.sh   in UNIX Environment
This Script compiles java files and creates MyPortal.war file.

Copy the MyPortal.war to <OC4J_HOME>\applications directory

Step 3: Edit the file application.xml present in <OC4J_HOME>\config directory and  add the following entry after the
                     <web-module id="defaultWebApp" path="../default-web-app" /> line:

       <web-module id="MyPortal" path="../applications/MyPortal.war" />

Step 4 : Edit the http-web-site.xml file present in <OC4J_HOME>\config directory and  add the following after the
                      <default-web-app application="default" name="defaultWebApp" /> line:

        <web-app application="default" name="MyPortal" root="/technology/MyPortal" />

Step 5: Start the OC4J Server

            java -jar oc4j.jar

Now, the application is deployed to OC4J.

Deploying the application to Oracle9iAS using Oracle9iAS Enterprise Manager


Viewlet of Oracle9iAS Enterprise Manager Deployment

This section describes the steps required in deploying this application to the Oracle9iAS using Oracle9iAS Enterprise Manager. These instructions are not necessary, if the application has been already deployed.

Step 1:  SET Path and ClassPath

Ensure that <JAVA_HOME>\bin is in the PATH, where <JAVA_HOME> is the directory where the JDK is installed.

Make sure that classes12.zip or classes12.jar is in the CLASSPATH.

Step 2:  Execute the following Shell Script :

  • <base>\MyPortal\createwar.bat   in Windows Environment (or)
  • <base>\MyPortal\createwar.sh   in UNIX Environment
This Script compiles java files and creates MyPortal.war file.

Copy the MyPortal.war to <OC4J_HOME>\applications directory

Step 3: Having created a MyPortal.war file, to deploy this application through Enterprise Manager (EM). Log into EM. The default admin username is ias_admin . Once you get into EM, click on OC4J_home link under the System Components section.

Step 4:  From the Applications section, Click on "Deploy WAR File".  This takes you to the screen where you can choose to upload the WAR file you created.

Step 5: Choose the MyPortal.war that you created, by clicking the "Browse" button. In the Application Name textfield, specify MyPortal as the name and specify the "Map to URL" value as /MyPortal. Click Deploy. On successful deployment, EM displays a success message. Click OK to return to the main screen

Configuring Oracle9iAS Web Cache


Viewlet of Configuring Oracle9iAS Web Cache

This section describes the steps to configure OC4J with Oracle9iAS Web Cache. If OC4J has been already configured for Oracle9iAS Web Cache, then ignore this section.

Step 1 : Start the Oracle9iAS Web Cache Admin Tool using the browser. By default the administration port is 4000. Access the Admin tool on the browser using the url

http://<hostname>:4000/webcacheadmin/
where <hostname> is the machine on which Oracle9iAS is installed.
For example, http://incq221b.idc.oracle.com:4000/webcacheadmin
Login as "administrator". The default password is 'administrator'.
Step 2 : Configure the Application Server
  1. Click on 'Application Web Servers' option under ' General Configuration'.
  2. Click the 'Add..' Button and enter the Application Server Specific details and press 'Submit' Button.
Step 3: Setup the Listen Port
  1. Go to 'Listening Ports' option under 'Cache-Specific Configuration'.
  2. Click the 'Add..' Button
    • Enter Listening IP Address - IP Address can takes value 'ANY' or the IP Address of the Machine which runs Oracle9iAS Web Cache
    • Enter Listening Port. - The Listening Port on which Oracle9iAS Web Cache will receieve web requests.
    • Wallet is only required for HTTPS Protocol.
    • Click 'Submit' Button.
Step 4: Set Site Definition
  1. Go to 'Site Definitions' option under 'General Configuration'.
  2. Click the 'Add Site..' Button
    • Enter Host Name- Enter the site's host name and domain name (hostname.domain), such as www.company.com.
    • Enter Port Number. - Enter the HTTP or HTTPS port number from which the Web site is listening for incoming requests.
    • Click 'Submit' Button.
Step 5: Set Server-to-Site Mapping.
  • Go to 'Site to Server Mapping' option under 'General Configuration'.
  • Click the Insert Above..' Button after selecting any of the sites listed.
    • Select the radio button 'Select from Site Definitions'
    • Select the Site Definition just defined from the list.
    • Select Application Web Servers from the list provided.
    • Click 'Submit' Button.
Step 6: Restart the Oracle9iAS Web Cache.
Apply the changes by clicking  the 'Apply Changes' button on top. Choose "Web Cache Operations" link under  "Administering Oracle Web Cache".

Restart Web Cache.

For more information, refer Oracle9iAS Web Cache Administration and Deployment Guide.

Running the Sample Application


Viewlet of Running the Sample

Step 1: Ensure that both OC4J and the Oracle9iAS are running.

Step 2: Access the page on the browser, using the url

                  http://<host_name>:<port>/MyPortal/Login.jsp
                  where, <host_name> is the machine on which Oracle9iAS Web Cache is installed and <port> is the port on which Web Cache listener is running.

                  For Example, http://insn062a.idc.oracle.com:2050/MyPortal/Login.jsp

            New user's can sign up to the system and get a valid loginname.
 
 

Viewlets in the Sample.

  1. Database Setup
  2. Deploying the Sample using Oracle9i JDeveloper
  3. Deploying the Sample Manually to OC4J
  4. Deploying the Sample using Oracle9iAS Enterprise Manager
  5. Configure Oracle9iAS Web Cache
  6. Running the Sample


Please enter your comments about this sample in the OTN Sample code discussion forum.
E-mail this page
Printer View Printer View