2

Hudson is a continuous integration engine that runs as a Java Servlet in tomcat. https://hudson.dev.java.net/

I have Tomcat 5.5 successfully installed on my CentOS 5.3 system. I can see and interact with it on port 8080.

I can upload the hudson.war file which reports success and appears to unpack everything correctly into the webapps directory.

However, when I attempt to start the hudson application from the tomcat web application manager page it fails reporting "FAIL - application at context path /hudson could not be started."

The balancer, admin, and other default webapps appear to start correctly.

SELinux is enabled on this system, which has caused me some trouble in the past. Not sure if it is relevant to this case.

The tomcat log looks like this:

8-Jul-09 4:32:15 PM org.apache.catalina.core.ApplicationContext log
INFO: HTMLManager: start: Starting web application at '/hudson'
8-Jul-09 4:32:16 PM hudson.WebAppMain contextInitialized
SEVERE: Failed to initialize Hudson
java.lang.NoClassDefFoundError: hudson.model.Hudson
   at java.lang.Class.initializeClass(libgcj.so.7rh)
   at hudson.WebAppMain.installLogger(WebAppMain.java:227)
   at hudson.WebAppMain.contextInitialized(WebAppMain.java:112)
   at org.apache.catalina.core.StandardContext.listenerStart(catalina-5.5.23.jar.so)

   ... snip ...

   at java.lang.Class.initializeClass(libgcj.so.7rh)
   ...24 more
8-Jul-09 4:32:16 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class hudson.WebAppMain
java.lang.NoClassDefFoundError: hudson.model.Hudson
   at java.lang.Class.initializeClass(libgcj.so.7rh)
   at hudson.WebAppMain.installLogger(WebAppMain.java:227)
   at hudson.WebAppMain.contextInitialized(WebAppMain.java:112)
   at org.apache.catalina.core.StandardContext.listenerStart(catalina-5.5.23.jar.so)

   ... snip ... 

   at org.apache.catalina.loader.WebappClassLoader.loadClass(catalina-5.5.23.jar.so)
   at java.lang.Class.forName(libgcj.so.7rh)
   at java.lang.Class.initializeClass(libgcj.so.7rh)
   ...24 more
8-Jul-09 4:32:16 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
8-Jul-09 4:32:16 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/hudson] startup failed due to previous errors
8-Jul-09 4:32:16 PM org.apache.catalina.core.StandardContext listenerStop
SEVERE: Exception sending context destroyed event to listener instance of class hudson.WebAppMain
java.lang.NoClassDefFoundError: hudson.model.Hudson
   at java.lang.Class.initializeClass(libgcj.so.7rh)
   at hudson.WebAppMain.contextDestroyed(WebAppMain.java:280)
   at org.apache.catalina.core.StandardContext.listenerStop(catalina-5.5.23.jar.so)

   ... snip ... 

   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(tomcat-util-5.5.23.jar.so)
   at java.lang.Thread.run(libgcj.so.7rh)
8-Jul-09 4:32:16 PM org.apache.catalina.core.ApplicationContext log
INFO: HTMLManager: list: Listing contexts for virtual host 'localhost'
chmeee
  • 7,370
  • 3
  • 30
  • 43
nolandda
  • 193
  • 1
  • 9

2 Answers2

1
java.lang.NoClassDefFoundError: hudson.model.Hudson

Looks like the class loader is unable to load the classes and it might be a permissions issue due to SELinux.

Can you try running the embedded version of Hudson, just to clear out that it can work on your system?

Robert Munteanu
  • 1,644
  • 5
  • 23
  • 41
1

I wasn't able to resolve this through configuration, so I took a lesson from Aliens and nuked it from orbit. It is, after all, the only way to be sure.

After clearing out the version installed by my package manager (yum) I went to the tomcat site and downloaded, installed, and configured their binary release of Tomcat 5.5 Core and Administration Web Application.

After that I had a few minor permissions issues, modified the script they keep in $CATALINA_HOME/bin/jsvc-src/native/Tomcat5.sh to run tomcat as a daemon, and now everything seems to work well.

I know, not a very satisfying answer, but I couldn't afford to bang my head against it any longer.

nolandda
  • 193
  • 1
  • 9