Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-8088

No name for JDK or Maven installs causes build error

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • maven-plugin
    • 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.

          [JENKINS-8088] No name for JDK or Maven installs causes build error

          Code changed in hudson
          User: : sogabe
          Path:
          trunk/hudson/main/core/src/main/java/hudson/model/JDK.java
          trunk/hudson/main/core/src/main/java/hudson/tasks/Ant.java
          trunk/hudson/main/core/src/main/java/hudson/tasks/Maven.java
          trunk/hudson/main/core/src/main/java/hudson/util/FormValidation.java
          trunk/hudson/main/core/src/main/resources/hudson/util/Messages.properties
          trunk/hudson/main/core/src/main/resources/hudson/util/Messages_ja.properties
          trunk/hudson/main/core/src/test/java/hudson/util/FormValidationTest.java
          http://jenkins-ci.org/commit/36901
          Log:
          [FIXED JENKINS-8088] check the name of Ant, Maven and JDK installations.

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : sogabe Path: trunk/hudson/main/core/src/main/java/hudson/model/JDK.java trunk/hudson/main/core/src/main/java/hudson/tasks/Ant.java trunk/hudson/main/core/src/main/java/hudson/tasks/Maven.java trunk/hudson/main/core/src/main/java/hudson/util/FormValidation.java trunk/hudson/main/core/src/main/resources/hudson/util/Messages.properties trunk/hudson/main/core/src/main/resources/hudson/util/Messages_ja.properties trunk/hudson/main/core/src/test/java/hudson/util/FormValidationTest.java http://jenkins-ci.org/commit/36901 Log: [FIXED JENKINS-8088] check the name of Ant, Maven and JDK installations.

          dogfood added a comment -

          Integrated in hudson_main_trunk #395
          [FIXED JENKINS-8088] check the name of Ant, Maven and JDK installations.

          sogabe :
          Files :

          • /trunk/hudson/main/core/src/main/resources/hudson/util/Messages_ja.properties
          • /trunk/hudson/main/core/src/main/java/hudson/model/JDK.java
          • /trunk/hudson/main/core/src/main/java/hudson/tasks/Maven.java
          • /trunk/hudson/main/core/src/main/java/hudson/util/FormValidation.java
          • /trunk/hudson/main/core/src/main/java/hudson/tasks/Ant.java
          • /trunk/hudson/main/core/src/test/java/hudson/util/FormValidationTest.java
          • /trunk/hudson/main/core/src/main/resources/hudson/util/Messages.properties

          dogfood added a comment - Integrated in hudson_main_trunk #395 [FIXED JENKINS-8088] check the name of Ant, Maven and JDK installations. sogabe : Files : /trunk/hudson/main/core/src/main/resources/hudson/util/Messages_ja.properties /trunk/hudson/main/core/src/main/java/hudson/model/JDK.java /trunk/hudson/main/core/src/main/java/hudson/tasks/Maven.java /trunk/hudson/main/core/src/main/java/hudson/util/FormValidation.java /trunk/hudson/main/core/src/main/java/hudson/tasks/Ant.java /trunk/hudson/main/core/src/test/java/hudson/util/FormValidationTest.java /trunk/hudson/main/core/src/main/resources/hudson/util/Messages.properties

          Code changed in hudson
          User: : sogabe
          Path:
          trunk/www/changelog.html
          http://jenkins-ci.org/commit/36905
          Log:
          Fixed JENKINS-8088

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : sogabe Path: trunk/www/changelog.html http://jenkins-ci.org/commit/36905 Log: Fixed JENKINS-8088

            sogabe sogabe
            hdave42 hdave42
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: