You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 19 Next »

Most of the customizations of the configuration files are due to David Wu who graciously helped tracking down and fixing all the NoSuchMethodErrors that appeared along the way.

This short document is about the steps to deploy Hudson onto Apache Geronimo 2. Hudson is a....go and read it on its web site. No need to duplicate their stuff here.

Geronimo 2.0.2 uses XStream 1.1.3. Hudson requires some methods of XStream that are only available in earlier versions and to deploy hudson successfully onto Geronimo, it's recommended to delete xstream-1.1.3.jar from Geronimo's lib directory and place xstream-1.2.2.jar instead. The latest releases of Geronimo have the file already replaced and there's no need to bother about it anymore if you're on Geronimo 2.0.2+.

The plan

The plan configures a security realm hudson-realm as well as /hudson as a context for hudson.war.

The plan filters out org.apache.commons.lang. package that comes with Apache Commons Lang 2.0 in Geronimo 2.0.2. As of Hudson 1.160, Apache Commons Lang 2.1 is required and is already included in the war file.

It appears that Hudson uses a customized version of Apache JEXL made specfically for itself so filtering the package from the web classloader is required.

hudson-geronimo-plan.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0">
  <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">
    <moduleId>
      <groupId>hudson</groupId>
      <artifactId>hudson</artifactId>
      <version>1.166</version>
      <type>war</type>
    </moduleId>
    <dependencies>
      <dependency>
        <groupId>org.apache.geronimo.configs</groupId>
        <artifactId>j2ee-security</artifactId>
        <type>car</type>
      </dependency>
    </dependencies>
    <hidden-classes>
      <filter>org.apache.commons.lang.</filter>
      <filter>org.apache.commons.jexl.</filter>
    </hidden-classes>
  </environment>

  <context-root>/hudson</context-root>

  <security-realm-name>hudson-realm</security-realm-name>
  <security>
    <default-principal realm-name="hudson-realm">
      <principal name="anonymous" class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" />
    </default-principal>
    <role-mappings>
      <role role-name="admin">
        <realm realm-name="hudson-realm">
          <principal name="AdminGroup" class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" />
        </realm>
        <principal name="system" class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" />
      </role>
    </role-mappings>
  </security>
</web-app>

Starting Geronimo

Run Geronimo with ./bin/geronimo.sh run -vv command.

jlaskowski@dev /cygdrive/c/geronimo-jetty6-jee5-2.0.2
$ ./bin/geronimo.sh run -vv
Using GERONIMO_BASE:   c:\geronimo-jetty6-jee5-2.0.2
Using GERONIMO_HOME:   c:\geronimo-jetty6-jee5-2.0.2
Using GERONIMO_TMPDIR: c:\geronimo-jetty6-jee5-2.0.2\var\temp
Using JRE_HOME:        c:\apps\java5\jre
...
Geronimo startup complete

Deploying hudson.war

Download hudson.war from its releases web page.

You can deploy hudson.war from the web console of Geronimo, but there's another way to do the same - executing deploy command on the command line.

jlaskowski@dev /cygdrive/c/geronimo-jetty6-jee5-2.0.2
$ ./bin/deploy.sh -u system -p manager deploy hudson.war hudson-geronimo-plan.xml
Using GERONIMO_BASE:   c:\geronimo-jetty6-jee5-2.0.2
Using GERONIMO_HOME:   c:\geronimo-jetty6-jee5-2.0.2
Using GERONIMO_TMPDIR: c:\geronimo-jetty6-jee5-2.0.2\var\temp
Using JRE_HOME:        c:\apps\java5\jre
    Deployed hudson/hudson/1.166/war @ /hudson

The Geronimo console shows deployment progress as follows:

hudson home directory: C:\Documents and Settings\jlaskowski\.hudson
2008-01-05 18:23:08 hudson.TcpSlaveAgentListener <init>
INFO: JNLP slave agent listener started on TCP port 1545
2008-01-05 18:23:09 hudson.model.Hudson load
INFO: Took 890 ms to load
18:23:13,515 INFO  [StaticWebApplicationContext] Refreshing org.springframework.web.context.support.StaticWebApplicationContext@2eec5a: 
display name [Root WebApplicationContext]; startup date [Sat Jan 05 18:23:13 CET 2008]; root of context hierarchy
18:23:13,515 INFO  [StaticWebApplicationContext] Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext@2eec5a]: 
org.springframework.beans.factory.support.DefaultListableBeanFactory@12333fb
18:23:13,546 INFO  [DefaultListableBeanFactory] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@12333fb: 
defining beans [filter,legacy]; root of factory hierarchy

Running the webapp

Point the browser of your choice to http://localhost:8080/hudson. You should see hudson's welcome page.

Setting up a new Maven2 job in hudson works fine too.

  • No labels