my recent reads..

Atomic Accidents: A History of Nuclear Meltdowns and Disasters; From the Ozark Mountains to Fukushima
Power Sources and Supplies: World Class Designs
Red Storm Rising
Locked On
Analog Circuits Cookbook
The Teeth Of The Tiger
Sharpe's Gold
Without Remorse
Practical Oscillator Handbook
Red Rabbit

Sunday, December 16, 2007

WebCenter Wiki - Up and Running with OC4J 10.1.3

I finally had a chance to sit down with Oracle WebCenter recently, primarily to give the wiki functionality a test drive. I wanted to test in a virgin OC4J 10.1.3.3 container (as opposed to the Preconfigured Standalone OC4J) just to make it interesting and see all the moving parts. As far as I could discover, there's not a great deal of information available on the topic. In this post I'm going to chronical the specific installation procedure I used to get WebCenter Wiki running under OCJ4 10.1.3.3.

This is the end result we're after..


Documentation and Downloads

The documentation for WebCenter Wiki is a little obscure when it comes to installing in a "plain" OC4J container. It turns out to be pretty straight-forward, but just as mc said in the forums recently: "Oracle documentation just make it look difficult"!

I refered to the following materials for the install:

It can all get a bit confusing, but the following diagram illustrates the installation dependencies

There are four downloads required, all readily available from OTN:

Installation Procedure


I'm going to document the install steps here in the order I actually executed them. Variations are possible. I'm installing this under Windows XP, but the same applies on other platforms (just switch \ to / and use the appropriate command shell syntax).

1. Get the OC4J container running
To be precise, I am using "Oracle Containers for J2EE (OC4J) 10g Release 3 (10.1.3.3)". I won't cover in detail here. Basically you need to unpack and startup. The only thing you may need to configure are the port settings to avoid conflicts with other services.

2. Install PDK-Java
Details for installing the Oracle Portlet Development Kit are in index.html from the Oracle Portlet Container and PDK-Java 10.1.3.2 download. Assuming we've exploded the download into "G:\pdksoftware", the following performs the installation into the 10.1.3.3 home:

set ORACLE_HOME=G:\MyCache\oc4j_extended_101330
set J2EE_HOME=%ORACLE_HOME%\j2ee\home
set JAVA_HOME=C:\bin\jdk1.6.0_03
set PDKPATH=G:\pdksoftware
%JAVA_HOME%\bin\java -jar -classpath %ORACLE_HOME%\lib\xmlparserv2.jar -jar %PDKPATH%\pdk\jpdk\v2\pdkinstaller.jar %J2EE_HOME%


3. Install the Portal Container
From the same kit, we install the Portlet container

set ORACLE_HOME=G:\MyCache\oc4j_extended_101330
set J2EE_HOME=%ORACLE_HOME%\j2ee\home
set JAVA_HOME=C:\bin\jdk1.6.0_03
set PDKPATH=G:\pdksoftware
%JAVA_HOME%\bin\java -jar %PDKPATH%\pdk\portlet-container\portlet-server-install.jar %J2EE_HOME%


4. Install and Test the Sample Portlets
Using Enterprise Manager (http://localhost:8888/em or similar), go to the "Applications" tab and deploy the %PDKPATH%\pdk\jpdk\v2\jpdk.ear.

Once done, you should be able to successfully access the sample providers at http://localhost:8888/jpdk/providers/sample and get a page like the one shown on the right.

5. Install ADF
Explode the Oracle ADF Installer, which uses a silent "runInstaller" to install.

First, you'll need to update the adfinstaller.properties file, paying particular attention to OracleHome, DesHome and type values. This is from my install:

# The absolute path to the directory containing the ADF jars to be installed.
# This is the location of the directory where you unzipped the adfinsatller.zip
OracleHome = G:\\Sources\\incoming\\www.oracle.com\\OracleAS\\ADF\\adfinstaller

# Home directory for the destination application server,
# where the ADF Jars need to be installed
DesHome = G:\\MyCache\\oc4j_extended_101330

# Specify the platform for the Application Server where the ADF libraries need
# to be installed. This has to be one of the following choices.
# OC4J/AS/TOMCAT/JBOSS/WEBLOGIC
type = OC4J

And then run:
java -jar runinstaller.jar adfinstaller.properties

Restart OC4J at this point.

BUT, if you were like me, my container failed to start at this point with Error initializing server: Shared library "adf.oracle.domain" could not be found..

Annoying, but no panic. Edit ORACLE_HOME/j2ee/home/config/server.xml, re-order the shared library entry for "adf.oracle.domain" (I moved it to just after the "oracle.persistence" shared library) and try to startup again.

NB: after getting to this point, I find my OC4J does not completely shutdown after issuing a shutdown request via RMI %ORACLE_HOME%\bin\oc4j -shutdown -port %RMIPORT% -password %adminpwd%. Leaving that problem for another day.. :sigh:

6. Install Oracle Wiki (finally)
Using Enterprise Manager (http://localhost:8888/em or similar), deploy the owc_wiki.ear from the Oracle WebCenter Additional Services CD

7. Configuring Security
If you try and hit the wiki now (http://localhost:8888/owc_wiki) you will probably get a 500 error because security is not started or configured.

For this test, I'm just going to use the out-of-the-box Java SSO File-Based Security Provider.

In EM, startup the Java SSO application (look under the application group "Middleware Services > Other Services"). If you try and access the wiki now, you should see a login form but get an error when you submit because we need to generate the Symmetric Key. Every time I go to do this, following the Java SSO documentation, I struggle to find the right link in EM.

To be clear, in 10.1.3 look for "SSO Configuration" on the Administration tab of the OC4J container (below). Go to the page, make sure "Generate new symmetric key" is checked, select your key type, and click "Apply". You will be prompted to restart OC4J.


Browse to the wiki again and we have .. Success!


8. Adding users
Remember we're using the JAZN XML security provider rather than OID or other directory. Andreas had a nice post recently on how to Add a user to the JavaSSO, and that's what I need to do to add a personal account for myself..

set ORACLE_HOME=G:\MyCache\oc4j_extended_101330
set J2EE_HOME=%ORACLE_HOME%\j2ee\home
set JAVA_HOME=C:\bin\jdk1.6.0_03

%JAVA_HOME%\bin\java -jar %J2EE_HOME%\jazn.jar -adduser jazn.com paul password1
%JAVA_HOME%\bin\java -jar %J2EE_HOME%\jazn.jar -grantrole users jazn.com paul

JAZN is a bit dumb compared to using a real directory, so you need to restart OC4J again to pick up the new credentials.


And there we go. Oracle Wiki up and running in OC4J. Just 8 "simple" steps;-)

3 comments:

Anonymous said...

excellent link. thank you..

Anonymous said...

Thank you so much for this guide! It saved me a lot of time.

Unknown said...

happy it helped;-)