This page last changed on Dec 12, 2007 by groldan.

OC4J

Oracle Containers for J2EE the the lightweight, Java developer focused version of Oracle Application Server. Its 100% Java so its easy to get going as you don't have to deal with the whole beast, their system requirements, admin complexity, etc. Yet it might be enough testing over OC4J to assess whether GeoServer runs correctly on Oracle Application Server.

Development environment

I'm going to document how to get started with OC4J on my dev environment, otherwise I'll forget since most things are one time setup issues.

OS: GNU/Linux, OpenSUSE 10.3_x86_64
Machine: Core2 Duo 2Ghz, 2GB RAM
java version "1.5.0_13"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_13-b05, mixed mode)

OC4J install

  • Download OC4J standalone (oc4j_extended_101330.zip) from Oracle Technology Network, you'll need to sign up for a free OTN account if don't have one.
  • Unzip to the target folder (need to exist before unzipping as the zip file has no root folder), /usr/local/dev/oc4j in my case.
  • Set the environment variable ORACLE_HOME to point to the root oc4j directory. (Either add it to ~/.bashrc or add ORACLE_HOME=/usr/local/dev/oc4j as the first line on bin/oc4j.

At this stage its supposed that running bin/oc4j -start should just work, but I had to dig on forums to find out why it was failing miserably.
The solution were just to make sure my host name were properly settled up on /etc/hosts and /etc/hostname

Start oc4j

Run bin/oc4j -start. The first time it starts up will ask for an administrator password, set it and press enter to continue loading.

gabriel@...146...:/usr/local/dev/oc4j> bin/oc4j -start
Starting OC4J from /usr/local/dev/oc4j/j2ee/home ...
2007-10-17 11:58:58.276 NOTIFICATION Auto-unpacking /usr/local/dev/oc4j/j2ee/home/applications/dms.war...
2007-10-17 11:58:58.279 NOTIFICATION Unjar /usr/local/dev/oc4j/j2ee/home/applications/dms.war in
 /usr/local/dev/oc4j/j2ee/home/applications/dms
..... (some lot more logs...)
INFO: Updating JtaAdmin account
07/10/17 11:59:00 Set OC4J administrator's password (password text will not be displayed as it is entered)
Enter password:
Confirm password:
The password for OC4J administrator "oc4jadmin" has been set.
07/10/17 11:59:15 The OC4J administrator "oc4jadmin" account is activated.
07/10/17 11:59:21 Oracle Containers for J2EE 10g (10.1.3.3.0)  initialized

Once started, go to the oc4j default page http://localhost:8888/, and then to the admin console to check out everything is working ok: http://localhost:8888/em.

Stop oc4j

To shut it down just press CTRL-C on the console.
If you went further and added it as a daemon or something, will have to run bin/oc4j -shutdown -port 23791 -password <password>, where 23791 is the default port assigned for RMI management of the server.

Deploy

Full deployment guide is located here.

For easy deployment log in to the admin console, and follow the Applications->Deploy wizard.

Out Of Memory Error

Got the following OOM when deploying the geoserver war:

2007-10-17 12:52:37.823 NOTIFICATION Application Deployer for geoserver FAILED.
07/10/17 12:52:38 java.lang.OutOfMemoryError: PermGen space
07/10/17 12:52:41 java.lang.OutOfMemoryError: PermGen space

To avoid it edit the bin/oc4j script so it passes the correct arguments to the java VM through the OC4J_JVM_ARGS environment variable. So the first non comment lines in the script become:

bin/oc4j
ORACLE_HOME=/usr/local/dev/oc4j
OC4J_JVM_ARGS="-server -Xmx512m -XX:MaxPermSize=256m"
J2EE_HOME=$ORACLE_HOME/j2ee/home

That deploys geoserver, but suddenly fails to initialize Struts:

...
17 Oct 13:10:17 INFO [geoserver.global] - Loading feature type 'tasmania_water_bodies:::tasmania_water_bodies' (layer 14/14)
2007-10-17 13:10:19.299 NOTIFICATION Initializing Servlet: org.vfny.geoserver.config.web.MultipleActionServlet for web application geoserver
17 Oct 13:10:19 ERROR [digester.Digester] - Digester.getParser:
org.xml.sax.SAXNotRecognizedException: http://apache.org/xml/features/validation/dynamic
        at oracle.xml.jaxp.JXSAXParserFactory.setFeature(JXSAXParserFactory.java:128)
        at org.apache.commons.digester.parser.XercesParser.configureXerces(XercesParser.java:185)
        at org.apache.commons.digester.parser.XercesParser.newSAXParser(XercesParser.java:138)
        at org.apache.commons.digester.ParserFeatureSetterFactory.newSAXParser(ParserFeatureSetterFactory.java:71)
        at org.apache.commons.digester.Digester.getParser(Digester.java:692)
...

When in the deployment wizard, go to Deploy->Deployment Settings: Configure Class Loading,
uncheck "Inherit parent application's shared library imports"

Now it is functional, finally...
WFS Capabilities works...
Home page works after fixing GEOS-1334

Document generated by Confluence on Apr 25, 2008 11:39