...| Home | Documentation...
Documentation > Installing DBPrism/Cocoon2 on OC4J >
EARs pre-packaged files >
+ Home ...
+ Download
> Documentation
+ DBPrism Content Management System
+ DBPrism - Apache Cocoon
+ Credits
+ Legal
 
+ Documentation
+ Frequently Asked Questions
+ Readme
+ Demos
+ Changes
+ Thigs To Do
+ Toolkits
+ JavaWebServer
+ Tomcat
> Installing DBPrism/Cocoon2 on OC4J
+ Installing DBPrism on Cocoon2/OC4J/Linux: Introduction
+ Apache/JServ on NT
+ Resin
+ Parameters
+ Internals
 
+ links
+ Yahoo.groups
+ OTN
+ OSCOM.org
 
Moreover news
+ IBM speeds Java on mainframes (CNET Asia)
+ Middle-aged mainframe converts to Java (ZDNet UK)
+ IBM speeds Java on mainframes (ZDNet)
+ IBM speeds Java on mainframes (CNET)
+ All Buttons (JavaBoutique)
+ Drag-and-Drop Editor Out for Linux Devs (Internet News)
+ Using Program Parameters in Java (JavaBoutique)
+ Sun pledges to cooperate with Microsoft (AP via Seattle Post Intelligencer)
+ Sun pledges to cooperate with Microsoft (Boston Globe)
+ Bitter legal feud ends with payment, Sun cuts 3,300 more jobs (China Post)
+ Sun and Microsoft settle (Chicago Sun-Times)
+ Microsoft to pay $1.6 billion, settle with Sun Microsystems (Baltimore Sun)
+ Visualize Hoovers Data With Anacubis (ResearchBuzz via ResearchBuzz)
+ Sun and BEA advance Java app offerings (Computer Weekly)
+ Sun wants to lift its Java profile (ZDNet UK)
+ 'Smack the Pingu' on Your Mobile Phone! (PA News via The Scotsman Online)
+ Third Generation Mobile Phone Game from Nihon Enterprise (Japan Corp)
+ Comment: Free but shackled - the Java trap (Sydney Morning Herald)
+ Sun plots Java comeback (CNET Asia)
+ Veritas and BEA vow to love Java together (The Register)
+ Microsoft and Sun's settlement will yield web services benefits and support for Java (Computer Weekly)
+ Sun plots Java comeback (CNET)
+ Sun plots Java comeback (ZDNet)
+ Sun enables new wave of mobile Java services (Sunday Times South Africa)
+ Sun Releases Sun Java Studio 6 (Techfocus)
+ Sam Pitrodas Telecom Firm Sets Up India Centre (Financial Express)
+ Multi Player Mobile Gaming (BBC)
+ Combining SOAP and JavaMail (Java Pro)
+ Draw Applet (JavaBoutique)
+ IBM dedicates module to Java on mainframes (CNET)
 
+ OTN News
+ View Live Customer Webcast Demos of Enterprise Manager 10g Grid Control
+ Oracle Database 10g for Windows Now Available for Download
+ Download New Oracle 10g JDBC Drivers
+ JDeveloper 10g Reviewed in Internet.com's Java Boutique
+ Java Developer's Journal Readers Name Oracle Products "Best" in Two Categories
+ New OracleAS Portal Extension for Macromedia Dreamweaver
+ Learn from the Experts During Java Week
+ Download Oracle Database 10g
+ New OracleAS Web Cache How-To Documents
+ Learn About SQL 2003 Support in Oracle Database 10g
+ New: Quick Installation Guide for RAC on Oracle Database 10g SE (Windows)
+ Oracle Forms Diagnostic Techniques
+ Introduction to JavaServer Faces
+ Prepare for Oracle Database 10g
+ New Tutorial: Learn JSP 2.0
+ Learn Best Practices for Consolidating Oracle on Linux Deployments
+ What's New in PL/SQL in Oracle Database 10g?
+ New Oracle 10g JDBC Samples
+ New Tech Tip: Using HttpUnit in Oracle JDeveloper 10g
+ Oracle 10g Supports Microsoft Windows Media Streaming Services and Windows Media File Format (ASF)
+ New Books at Oracle 10g Book Center
+ Tech Tip: Using JSTL SQL in Oracle JDeveloper 10g Preview
+ New Technical Article Series: The Hitchhiker's Guide to PHP
+ New Enterprise Manager 10g Grid Control Hands-on Tutorial
+ OC4J 10g (10.0.3) Developer Preview 2 Now Available
+ Download the New Oracle JDeveloper Application Migration Assistant (AMA) Search Rules for WebLogic Migrations
+ Learn Oracle in 2 Days
+ Download the new Oracle XDK 10g Production Release
+ Explore New JDBC 10g How-To's
+ New Oracle 10g JDBC Sample: CachedRowSet
+ New RowSet Implementation Tutorial Series
+ Download 2003 ODTUG Conference Papers
+ New Tutorial: Understanding TLD Caching in JSPs
+ Deploy the New J2EE 1.4 Adventure Builder Reference Application to OC4J
+ Download New Servlet Advanced Sample Applications
+ New: Oracle XDK 10g Unicode Support and XSLT Extension Sample App
+ New Oracle Application Server ProcessConnect End-to-End Samples
DBPrism at SourceForge
Built with Cocoon2
Documentation
 
Installing DBPrism/Cocoon2 on Oracle9iAS Container for J2EE

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

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

NoteOracle 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

NoteOC4J 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

Oracle recommend that you tunnel requests to the J2EE Container from Apache using mod_proxy. Although this is not necessary, it ensures that all pages that are served by the Oracle9i Application Server can benefit from other Oracle9i Application Server services--such as SSL and WebCache. This avoids wasting Java resources for serving static pages.

This is a simple step that could be done adding these lines to Apache httpd.conf file:

          <IfModule mod_proxy.c>
            ProxyRequests Off
            ProxyPass         /dbprism/ http://<oc4j-host>:8888/dbprism/
            ProxyPassReverse  /dbprism/ http://<oc4j-host>:8888/dbprism/
          </IfModule>
          

A more structured way is to create a file called oc4j.conf file with the above lines and to modify Apache httpd.conf with the line:

include "/u01/app/oracle/product/8.1.7/Apache/Apache/conf/oc4j.conf"

Preparing OC4J 9.0.x to run Cocoon2 and DBPrism

OC4J 9.0.x version uses Oracle XML parser instead of Xalan and Xerces then, instead of replace the version of these products is necessary to set xalan and xerces in front of oc4j.jar

  • Copy xerces-xml-apis.jar from $CMS_HOME/dbprism/WEB-INF/lib to $ORACLE_HOME/j2ee/home/lib/xerces.jar
  • Copy xalan.jar from $CMS_HOME/dbprism/WEB-INF/lib to $ORACLE_HOME/j2ee/home/lib/xalan.jar
  • Finally replace the start.sh script adding the corresponding flag to the java interprete for inserting xalan and xerces in front of xmlparserv2.jar, here the example:
#!/bin/sh
# Start script (start.sh)
# adds path to java virtual machine executable file
export PATH=/usr/local/jdk1.3.1/bin:$PATH
java -showversion -Xmx256m -Xbootclasspath/a:lib/xerces.jar:lib/xalan.jar -jar orion.jar

NoteThe first two files into Class-Path line will be xalan.jar and xerces.jar

NoteIf you will use Oracle Lite with DBPrism / Cocoon2 adds to the previous file a reference to lib/Olite40.jar, also the path separator for windows is ; then instead of the string lib/xerces.jar:lib/xalan.jar use lib/xerces.jar;lib/xalan.jar


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

/dpls zone stand for DBPrism pls mount point and tends to emulate Apache mod_plsql zone /pls, this zone is pre-configured with DBPrism working on IAS mod_plsql/OAS/OWS backward compatibility.

NoteA pre-packaged file dpls.ear could be downloaded at Download section.

build-dpls.bat makes a dpls.ear file, which is ready to be excecuted at $PRISM_HOME/applications directory for windows and build-dpls.sh for unix. Here the code of .bat and .sh version.

@echo off
@echo requires PATH including JAVA_HOME/bin directory
@echo Building dpls.ear ....
mkdir ..\stage\dpls
xcopy /e dpls ..\stage\dpls
@echo including last minute changes on Prism.jar...
mkdir ..\stage\dpls\dpls\WEB-INF\lib
copy ..\bin\Prism.jar ..\stage\dpls\dpls\WEB-INF\lib\Prism.jar
cd ..\stage\dpls\dpls
jar cvf ../dpls.war .
cd ..
rmdir /q /s dpls
jar cvf ../dpls.ear .
cd ..
rmdir /q /s dpls
copy dpls.ear ..\bin
del dpls.ear
cd ..\applications
@echo Building dpls.ear done. (look at ..\bin directory)
echo "requires path including JAVA_HOME/bin directory"
echo "Building dpls.ear ...".
mkdir ../stage/dpls
cp -rp dpls ../stage
echo "Including last minute changes on Prism.jar"
cp ../bin/Prism.jar ../stage/dpls/dpls/WEB-INF/lib
cd ../stage/dpls/dpls
jar cvf ../dpls.war .
cd ..
rm -rf dpls
jar cvf ../dpls.ear .
cd ..
rm -rf dpls
mv dpls.ear ../bin
cd ../applications
echo "Building dpls.ear done. (look at ../bin directory)"

Before run these scripts set JAVA_HOME variable in order to provide to the script the availability of run java jar utility.

Into PRISM_HOME/bin directory a file called dpls.ear has been created, copy this file to ORACLE_HOME/j2ee/home/applications directory. Then edits the files server.xml, http-web-site.xml located into ORACLE_HOME/j2ee/home/config directory adding these lines:

server.xml , this line says to OC4J server where dpls.ear is located

                  <application name="dpls" path="../applications/dpls.ear" />
          

http-web-site.xml , this line says to OC4J server which directory is used as mount point for this application ( http://server:port/dpls/dad_name/pkg.proc for example)

                  <web-app application="dpls" name="dpls" root="/dpls" /> 
          
Explanation

This pre-packaged file includes DBPrism configured as IAS mod_plsql/OAS/OWS compatibility. To avoid the problem of different configuration, it includes a private copy of Prism.jar located on ORACLE_HOME/j2ee/home/applications/dpls/dpls/WEB-INF/lib directory and a private copy of prism.properties file located on ORACLE_HOME/j2ee/home/applications/dpls/dpls directory.

web.xml file which includes the definition for the DADs has a simple DAD defined called sample , edits prism.properties file with the correct values for username, password and connect string for the target database.

To add or configure more than one DAD, do these steps

  • add the DAD name, to the parameter global.alias on prism.properties file.
  • set username,password, and so on on prism.properties file too.
  • create an alias, on web.xml file (servlet mapping section).

Here an example for a DAD demo which will be used with the url http://server:port/dpls/demo/package_name.procedure_name?args

- on prism.properties file located on
ORACLE_HOME/j2ee/home/applications/dpls/dpls directory.

global.alias=sample examples lite java demo
demo.dbusername=scott
demo.dbpassword=tiger
demo.connectString=jdbc:oracle:thin:@localhost:1521:orcl
demo.errorLevel=2
demo.errorPage=http://localhost/error.html
demo.compat=8i
demo.toolkit=4x
demo.StateLess=true

- on web.xml file located on
ORACLE_HOME/j2ee/home/applications/dpls/dpls/WEB-INF directory.

              <servlet-mapping>
                    <!-- Servlet mappimg for DAD demo -->
                    <servlet-name>
                        dpls
                    </servlet-name>
                    <url-pattern>
                        /demo/*
                    </url-pattern>
              </servlet-mapping>
            


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.

NoteDBPrism adds to Cocoon2 an special component named External Cache Invalidator, this component needs to be register on user.roles file

Notesitemap.xmap file has an special section for DBPrism configuration, I will explained more in detail in this section.

NoteA 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" /> 
          
Explanation

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.





EARs pre-packaged files >
Last Update: 2003-08-07 09:41:51.0| webmaster@dbprism.com.ar
Search | Use AltaVista (TM) query syntax<<
Quick Links<<
(C) 2003 - DBPrism ~ DBPrism CMS | Marcelo F. Ochoa | TANDIL ~ Argentina