bengreen.eu Circle Device

 

Techie Stuff

Projects

Quick Reference

Will be moved to Quick Reference soon

Compiling and Running LibrePlan with Jetty 8

After having looked around for a project management system for one of my clients at work I found LibrePlan, based on the Spring Framework (an old version 2.5) and ZK User Interface. I had some problems in that when I executed it from Maven it ran out of PermGen space no matter how much I allocated! Naturally my client was getting rather frustrated with this and I needed a solution.

I like GIT, you can get LibrePlan from the git repo here: git://libreplan.git.sourceforge.net/gitroot/libreplan/libreplan

Following the instructions on the LibrePlan site was fine but some things were missing or just a little outdated. My version of Jetty is the latest from eclipse which does not work properly with the file that Maven generated for me :-(.

Get Jetty installed and working

Seems obvoious but please make sure Jetty is actually working with the examples before you move on... it will save you a lot of frustration

Compile LibrePlan with Maven

The HACKING file that comes with the distribution will help you with this, it is fairly simple and you cannot easily go wrong. I did not compile any support for reports into mine because I just want to see how it will work first. Also, I do not have all the dependencies installed!

mvn -Ppostgresql,-reports,-userguide -DskipTests clean install

Once you have compiled the code you will have a target directory. From here we will copy the libreplan-webapp directory and the libreplan-webapp.war into our jetty/webapps directory.

Rewrite the jetty-env.xml file

Some of the classes in this file do not match with the version of Jetty we want to use (Jetty 8).

<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
    "http://jetty.mortbay.org/configure.dtd">

<Configure class="org.eclipse.jetty.webapp.WebAppContext">

    <New id="libreplan-ds" class="org.eclipse.jetty.plus.jndi.Resource">
        <Arg>jdbc/libreplan-ds</Arg>
        <Arg>
            <New class="org.springframework.jdbc.datasource.DriverManagerDataSource">
                <Set name="driverClassName">org.postgresql.Driver</Set>
                <Set name="url">jdbc:postgresql://localhost/libreplandev</Set>
                <Set name="username">libreplan</Set>
                <Set name="password">libreplan</Set>
            </New>
        </Arg>
   </New>
</Configure>

This file is in the libreplan/libreplan-webapp/target/jetty directory if you followed the instructions in the LibrePlan HACKING file. I was using Maven 3.0.4.

For this file to have any effect you must put it in the WEB-INF directory of webapps/libreplan-webapp.

Not working!!

At this stage we get some annoying error messages about JNDI (the Java Naming and Directory Interface) you see this functonality is not loaded into Jetty by default so we must edit the start.ini file. I have read conflicting information about this but this worked for me. (jetty-distribution-8.1.3.v20120416)

#===========================================================
# Configuration files.
# For a full list of available configuration files do
#   java -jar start.jar --help
#-----------------------------------------------------------
#etc/jetty-jmx.xml
etc/jetty.xml
etc/jetty-annotations.xml
# etc/jetty-ssl.xml
# etc/jetty-requestlog.xml
etc/jetty-deploy.xml
#etc/jetty-overlay.xml
etc/jetty-webapps.xml
etc/jetty-contexts.xml
etc/jetty-testrealm.xml
etc/jetty-plus.xml
#===========================================================

I added etc/jetty-plus.xml to enable JNDI.

More Memory!

JAVA_OPTS my first problem was PermGen space, and in the hacking file it tells you to increase the space using JAVA_OPTS although I did this it did not work well under Maven, now I have gotten rid of maven and I am just using Jetty I must still provide the JAVA_OPTS as specified in the INSTALL file.

export JAVA_OPTS="-Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m"
export JAVA_OPTS="${JAVA_OPTS} -server -Djava.awt.headless=true"
java -jar start.jar

One last note

None of this will work properly if you have not configured your database, please make sure you read the INSTALL and HACKING files provided with LibrePlan, this is not intended to be a standalone document and will not work as such ;-).

References

Easy Way Out?

I found a site with a .deb that some of you might want...libreplan tool 1.2.1. Not as recent as my version!

Quick Links: Techie Stuff | General | Personal | Quick Reference