DBPrism 2.0.0 is primary developed and tested on OC4J servlet container.
This document tends to help you how to configure DBPrism / Cocoon2 with
the OC4J 9.0.x. Documents with instructions for differents servlet
engines are located on section
Documentation
.
The Oracle9iAS new J2EE container, OC4J, is based on some technology licensed
from Ironflare Corporation, which develops the OrionServer--one of the market's
leading J2EE containers.
This cotainer is written entirely in Java that executes on the standard Java
Development Kit (JDK) Virtual Machine (JVM), then I will show step by step install
instructions on Unix platform but these steps are similar to win32 platform.
Installing OC4J requires two simple steps:
-
Unpack the distribution,
unziping the distribution file
-
Launch the installer,
through the java virtual machine
OC4J could be unpacked on any directory, but Oracle recomends into $ORACLE_HOME
directory, then excecute these commands logged as oracle owner.
 |  |  |
 |
# cd $ORACLE_HOME
# ls -l /mnt/cdrom
total 14100
-r--r--r-- 1 root root 9515023 May 24 13:53 oc4j.zip
-r--r--r-- 1 root root 4890141 May 24 13:53 petstore.zip
# unzip /mnt/cdrom/oc4j.zip
Archive: /mnt/cdrom/oc4j.zip
creating: j2ee/
creating: j2ee/home/
inflating: j2ee/home/admin.jar
....
inflating: j2ee/home/lib/xalan.jar
inflating: j2ee/home/lib/xerces.jar
# cd $ORACLE_HOME/j2ee/home
|  |
 |  |  |
 | Oracle JDeveloper 9i already have installed a 9.0.x version of OC4J |
Excecute install command, the installation prompts you for an administration
username and password, which is used for the administration console command-line tool:
 |  |  |
 |
# java -jar oc4j.jar -install
Enter an admin password to use: admin
Confirm admin password: admin
Installation done
#
|  |
 |  |  |
Test your installed server launching it with the following command and navigate
at the url http://localhost:8888/
, specially on JSP examples.
 |  |  |
 |
# java -jar oc4j.jar
Oracle9iAS (9.0.3.0.0) Containers for J2EE initialized
|  |
 |  |  |
 | OC4J is installed with the Sun Microsystems JDK version 1.2.2_07 tools.jar.
If you want to use your own tools.jar or if you receive a versioning
problem because you use version 1.3, copy the lib/tools.jar from your version of
the JDK installation to the j2ee/home/ root installation directory. Make sure that
you copy this JAR file to the j2ee/home directory and not to the j2ee/home/lib
directory. |
Starting, Stoping and Re-starting through scripts. OC4J is operated through java -jar
commands, but in many cases a shell or .bat script is
the best solution, here there is an examples to do it:
 |  |  |
 |
#!/bin/bash
# Shutdown script (start.sh)
export DISPLAY=localhost:0.0
export JAVA_HOME=/usr/java/jdk1.3
export PATH=$JAVA_HOME/bin:$PATH
java -server -Xnoclassgc -Duser.language=en -showversion -Xmx128m \
-Xbootclasspath/a:lib/xerces.jar:lib/xalan.jar -jar oc4j.jar -userThreads
|  |
 |  |  |
 |  |  |
 |
#!/bin/sh
# Shutdown script (shutdown.sh)
export PATH=/usr/local/jdk1.3.1/bin:$PATH
java -jar admin.jar ormi://localhost/ admin admin -shutdown force
|  |
 |  |  |
 |  |  |
 |
#!/bin/sh
# Restart script (restart.sh)
export PATH=/usr/local/jdk1.3.1/bin:$PATH
java -jar admin.jar ormi://localhost/ admin admin -restart
|  |
 |  |  |
|
Configuring Apache through mod_proxy |
Preparing OC4J 9.0.x to run Cocoon2 and DBPrism |
Adding a new zone to OC4J |
Every zone on OC4J architecture requires three simple steps to work.
-
Makes an EAR file distribution,
packing all requires files by the zone
-
Edits server.xml file,
located on $ORACLE_HOME/j2ee/home/config directory
-
Edits http-web-site.xml file,
located on $ORACLE_HOME/j2ee/home/config directory.
|
Creating a zone /dpls, emulating Oracle Apache mod_plsql mount point /pls |
Creating a zone /dbprism, working with Cocoon 2 |
/dbprism
zone is a mainly zone for DBPrism
,
this zone is pre-configured with DBPrism working with Cocoon2 and with Java
Stored Procedure support. Also is configured for DBPrism CMS. The Cocoon jar
included into this application deployment is based on Cocoon 2.0.3
release, to upgrade this version first upgrade the respective jars detailed on
the section Preparing OC4J to run Cocoon2 and DBPrism
, then upgrade the cocoon.jar and other related libs located in this application directory and finally update cocoon.xconf and sitemat.xmap which are strongly related to the version of cocoon.
 | DBPrism adds to Cocoon2 an special component named External Cache Invalidator, this component needs to be register on user.roles file |
 | sitemap.xmap file has an special section for DBPrism configuration, I will
explained more in detail in this section. |
 | A pre-packaged file dbprism.ear could be downloaded at
Download
section. |
To build and deploy dbprism.ear file you can use Oracle JDeveloper 9i, open
the project named CMS.prj located into $CMS_HOME directory, navigate to the
Deployment branch into the System Navigator and use webapp.deploy file.
To manually dbprism.ear file, copy this file
to ORACLE_HOME/j2ee/home/applications directory. Then edits the files server.xml,
and http-web-site.xml located into ORACLE_HOME/j2ee/home/config directory adding these
lines:
server.xml
, this line says to OC4J server where dbprism.ear is located
 |  |  |
 |
<application name="dbprism" path="../applications/dbprism.ear" />
|  |
 |  |  |
http-web-site.xml
, this line tells to OC4J server which directory
is used as mount point for this application
( http://server:port/dbprism/dad_name/pkg.proc
for example)
 |  |  |
 |
<web-app application="dbprism" name="dbprism" root="/dbprism" />
|  |
 |  |  |
This pre-packaged file includes DBPrism configured to work with Cocoon 2.
To avoid the problem of differents configuration, it includes a private copy of
Prism.jar and cocoon.jar located on ORACLE_HOME/j2ee/home/applications/dbprism/dbprism/WEB-INF/lib
directory and a private copy of prism.properties file located on ORACLE_HOME/j2ee/home/applications/dbprism/dbprism
directory.
web.xml
is based on Cocoon's web.xml file, it only has a simple
servlet mapping entry which redirects every url (starting at /dbprism) to Cocoon framework,
request which are redirected to DBPrism will be proecessed first by the Cocoon engine.
Unlike dpls.ear file this deployment profile do not require to edit web.xml file
to add other DADs, this is based on the parameter global.behavior=1
which tells to DBPrism that extracts the DAD from Path Info information of the servlet request.
Also this pre-packaged file includes Cocoon's configuration files with the necessary changes
for the DBPrism / Cocoon CMS and the examples. Look at the Cocoon Files
section for more details.
|
|
|