-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
Linux 64 bit, Ubuntu 10.04, Tomcat 6, Sun Java 6
This happened on a brand new instance of Hudson.
I went into "Configure Hudson, and specified the Java JDK and Maven versions I wished to be installed. I then created a new Maven job out of a small Java project I had. When I went to build the module, I got a very obscure ClassNotFoundException:
[domain] $ /opt/hudson_home/tools/bin/java -Xms256m -Xmx1024m -cp /opt/hudson_home/plugins/maven-plugin/WEB-INF/lib/maven-agent-1.384.jar:/opt/hudson_home/tools/boot/classworlds-1.1.jar hudson.maven.agent.Main /opt/hudson_home/tools /var/lib/tomcat6/webapps/hudson/WEB-INF/lib/remoting-1.384.jar /opt/hudson_home/plugins/maven-plugin/WEB-INF/lib/maven-interceptor-1.384.jar 44898
Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/classworlds/ClassRealm
Caused by: java.lang.ClassNotFoundException: org.codehaus.classworlds.ClassRealm
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: hudson.maven.agent.Main. Program will exit.
ERROR: Failed to launch Maven. Exit code = 1
Finished: FAILURE
It was clear that the class paths were wrong because when I inspected the tools directory, nothing was there. It took my about 3 hours to track down the fact that if you don't give the installs a name, then you don't get a directory under tools.
I think that the "Configure Hudson" screen should not let you save a tool install configuration without a name, thus preventing this problem for future newbies.