Building eXo Portal with JDK 6 and JOnAS 5.0.2

Hacking eXo Portal to use JOnAS 5 and JDK 6

This page is wrote on 2008/04/09, and at this date, eXo Portal is not yet compatible with JOnAS 5.

First of all, I'm neither a member of JOnAS team, nor eXo Team... just a poor lonesome "warrior" struggling for a working eXo Portal under JOnAS !

Thanks to members of each teams, and individual subscribers of the lists in helping me to do that work.

The script below indends to hack some files in eXo repository, in order to make it build eXo's EAR. At this time, the EAR is build, but there's some unknown dependancies in eXo code which make the EAR deployment fails.

So some adaptation may be used on earlier versions of eXo Portal... I hope it would be soon unecessary !

The script

See the file attached here

Its usage is :

install.sh <dir where installation files are> <where to work>

example : 

install.sh /home/me/src /usr/exo

This script pretends to find in $1 those files : 

  • apache-maven-2.0.8-bin.tar.bz2 
  • exoportal_src.tbz2 : source files checkout from eXo SVN repository
  • jdk-6u5-linux-i586.bin
  • jonas-osgi-5.0.2-bin.tar.gz
  • usr/exo/java/exo-working/exo-jonas/unix/eXo.sh : the file to replace further (directory tree needed)

Please note that there may be a bug if you add "/" add the end of specified directories. Script is still aplha....quickly written ...

Quickly explained

Starting from eXo WIKI, I've adopted another directory structure, very close from eXo's WIKI :

/usr/exo/
   java/
        exo-dependencies/
            jonas
            repository
        exo-working/
            exo-jonas/
        java
        maven
    softs/
        apache-maven-2.0.8/
        eXoProjects/
        jdk1.6.0_05/
        jonas-osgi-5.0.2/

Here's a short explanation : 

DirectoryWhat's for ?
/usr/exo/java/exo-dependencies/jonasis a symlink to /usr/exo/softs/jonas-osgi-5.0.2
/usr/exo/java/exo-dependencies/repositoryis the directory where maven puts eXo's stuff while building
/usr/exo/java/exo-working/exo-jonasis a the final directory where everything is build
/usr/exo/java/javais a symlink to /usr/exo/softs/jdk1.6.0_05
/usr/exo/java/mavenis a symlink to /usr/exo/softs/apache-maven-2.0.8

Plese note all those directories are setup in the script !

What it does ?

Please note also that at the moment, the installation script does not ends because of my lacks in Bash programming ; you must finish manually the process : 

cd $EXO_DEST_DIR/
exobuild --product=portal --build --deploy=jonas 2>&1> exobuild.log
cd $EXO_DEST_DIR/java/exo-working/exo-jonas/bin
cp $EXO_SRC_DIR/`pwd`/unix/eXo.sh unix/eXo.sh
ln -s unix/eXo.sh
chmod +x eXo.sh jonas setenv unix/*.sh

You see that the installation scripts replace /usr/exo/java/exo-working/exo-jonas/bin/unix/eXo.sh original file by another made by my 10 fingers that you'll can find there. I think this script is more convenient.

When build finished, you'll find a working JOnAS environment in /usr/exo/java/exo-working/exo-jonas.

Running JOnAS IS working 

/usr/exo/java/exo-working/exo-jonas/eXo.sh start

BUT there is at this moment some things that I can't explain (waiting for exo mailing list's answer...)

First :

008-04-09 13:46:50,725 : QuartzScheduler.<init> : Quartz Scheduler v.1.5.0-RC2 created.
java.lang.RuntimeException: Cannot instantiate component
class org.exoplatform.services.scheduler.impl.QuartzSheduler
[...]
Caused by: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method
"org.quartz.impl.StdScheduler.setJobFactory(Lorg/quartz/spi/JobFactoryV" the
class loader (instance of org/ow2/easybeans/loader/EasyBeansClassLoader) of
the current class,
 org/quartz/impl/StdScheduler, and the class loader
(instance of org/apache/felix/framework/searchpolicy/ContentClassLoader) for interface org/quartz/Scheduler have different
Class objects for the type org/quartz/spi/JobFactory used in the signature
is it grave doctor ?

Second :

2008-04-09 13:46:59,047 : InitialContextInitializer.addPlugin : Reference bound: jdbcexo
ERROR: cannot create portal container. ServletContext: org.apache.catalina.core.ApplicationContextFacade@48c85b
java.lang.RuntimeException: Cannot instantiate component class
org.exoplatform.services.jcr.ext.hierarchy.impl.NodeHierarchyCreatorImpl
[...]
Caused by: java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSourceFactory
However, commons-dbcp-1.2.1.jar is in EAR's dir (/exo-jonas/deploy/exoplatform.ear/lib)

Third :

2008-04-09 11:56:11,177 : StandardContext.loadOnStartup : Servlet /portal threw load() exception
java.lang.NullPointerException
    at org.exoplatform.portal.application.PortalController.init(PortalController.java:67)
while reading the code, i think it is because rootContainer.createPortalContainer(config.getServletContext())  did not succed.

Fourth : (happened more than one time)

2008-04-09 11:56:11,707 : StandardContext.listenerStart : Exception sending context initialized event to listener instance of
class org.exoplatform.services.portletcontainer.impl.servlet.PortletApplicationListener
java.lang.NoClassDefFoundError: com/sun/org/apache/xerces/internal/dom/DOMInputImpl
[...]
Caused by: java.lang.ClassNotFoundException: com.sun.org.apache.xerces.internal.dom.DOMInputImpl
even if xercesImpl-2.8.1.jar would be in EAR's lib dir, DOMInputImpl's package is org.apache.xerces.dom (no internal). What library does it refers to ?

Fitfh : (happened more than one time)

2008-04-09 11:56:12,499 : SkinService.processMergeRecursively : Problem while merging CSS : /skin/PortletThemes/Stylesheet.css
java.lang.NullPointerException
    at org.exoplatform.portal.webui.skin.SkinService.processMergeRecursively(SkinService.java:155)
The file /skin/PortletThemes/Stylesheet.css exists ?! Why BufferReader fails ?

Sixth :

2008-04-09 11:56:15,184 : StandardContext.loadOnStartup : Servlet /cometd threw load() exception
java.lang.IncompatibleClassChangeError: Implementing class
Cometd won't work,  grave ?

So this work is still in progress !
I'll update this wiki as soon as my work will go furher...

Steph33560, le 9 avril 2008 

Thank You