• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • nunit-plugin
    • None
    • Platform: All, OS: All

      Nunit plugin failes under startup because of classpath dependency to the native
      maven support - which has been refactored and pulled out as a plugin in 1.296.

      --------------------------------
      SEVERE: Failed to load a plug-in nunit
      hudson.util.IOException2: Failed to initialize
      at hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:223)
      at hudson.PluginManager.<init>(PluginManager.java:154)
      at hudson.model.Hudson.<init>(Hudson.java:513)
      at hudson.WebAppMain$2.run(WebAppMain.java:191)
      Caused by: java.lang.NoClassDefFoundError: hudson/maven/agent/AbortException
      at hudson.plugins.nunit.PluginImpl.start(PluginImpl.java:32)
      at
      hudson.ClassicPluginStrategy.startPlugin(ClassicPluginStrategy.java:231)
      at hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:220)
      ... 3 more
      Caused by: java.lang.ClassNotFoundException: hudson.maven.agent.AbortException
      at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
      ... 6 more

          [JENKINS-3427] nunit plugin fails in hudson-1.296

          Paul Nyheim added a comment -

          Please disregard the first patch I uploaded (attachement 648). It was a bit
          hasty. Use the second one (attachement 650).

          Paul Nyheim added a comment - Please disregard the first patch I uploaded (attachement 648). It was a bit hasty. Use the second one (attachement 650).

          redsolo added a comment -

          Thanks for notifying me and providing a patch.

          redsolo added a comment - Thanks for notifying me and providing a patch.

          redsolo added a comment -

          Thanks for notifying me and providing a patch.

          redsolo added a comment - Thanks for notifying me and providing a patch.

          Code changed in hudson
          User: : redsolo
          Path:
          trunk/hudson/plugins/nunit/src/main/java/hudson/plugins/nunit/NUnitPublisher.java
          http://fisheye4.cenqua.com/changelog/hudson/?cs=16865
          Log:
          [FIXED JENKINS-3427] - nunit plugin no longer fails in hudson-1.296

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : redsolo Path: trunk/hudson/plugins/nunit/src/main/java/hudson/plugins/nunit/NUnitPublisher.java http://fisheye4.cenqua.com/changelog/hudson/?cs=16865 Log: [FIXED JENKINS-3427] - nunit plugin no longer fails in hudson-1.296

          This is really a bug in the core. Plugins should retain visibility to maven
          plugin, even though it was refactored out as a plugin.

          Also, We shouldn't just throw away an useful error messages. The convention with
          hudson.AbortException is to report an error to TaskListener then throw this
          exception.

          Could the fix be updated to do that?

          Kohsuke Kawaguchi added a comment - This is really a bug in the core. Plugins should retain visibility to maven plugin, even though it was refactored out as a plugin. Also, We shouldn't just throw away an useful error messages. The convention with hudson.AbortException is to report an error to TaskListener then throw this exception. Could the fix be updated to do that?

          Capturing the regression in the core as issue #3436. I'm keeping this bug open
          to indicate that the error message be restored, but that's up to redsolo to decide.

          Kohsuke Kawaguchi added a comment - Capturing the regression in the core as issue #3436. I'm keeping this bug open to indicate that the error message be restored, but that's up to redsolo to decide.

          Paul Nyheim added a comment -

          What exactly are you suggesting?

          1. Should the fix be reverted back to using hudson.maven.agent.AbortException

          or

          2. Should the fix use hudson.AbortException, and log errors to the listener?

          On a side note, I have noticed the following:

          • cppunit plugin contains the same usage of hudson.maven.agent.AbortException
          • the checkstyle and the tasks plugin uses a different approach - and defines
            its own hudson.plugins.[checkstyle|tasks].util.AbortException which it catches
            just before leaving the perform method, logs the message from the exception,
            sets build result to failure and returns false.

          IMO, the approach of checkstyle and tasks plugin seems the best one, but
          approach 1 is of course the simplest if the visibility issue is fixed.
          Regards,
          Paul Nyheim

          Paul Nyheim added a comment - What exactly are you suggesting? 1. Should the fix be reverted back to using hudson.maven.agent.AbortException or 2. Should the fix use hudson.AbortException, and log errors to the listener? On a side note, I have noticed the following: cppunit plugin contains the same usage of hudson.maven.agent.AbortException the checkstyle and the tasks plugin uses a different approach - and defines its own hudson.plugins. [checkstyle|tasks] .util.AbortException which it catches just before leaving the perform method, logs the message from the exception, sets build result to failure and returns false. IMO, the approach of checkstyle and tasks plugin seems the best one, but approach 1 is of course the simplest if the visibility issue is fixed. Regards, Paul Nyheim

          I'll improve the AbortException in the core to take the string argument, and
          have the catcher report that into the log.

          Once that's in place, I recommend the the nunit and cppunit plugin to just
          replace hudson.maven.agent.AbortException by hudson.AbortException. The
          checkstyle and tasks plugin should be able to do the same, too, and there won't
          be a need for anyone to define their own AbortException classes.

          Kohsuke Kawaguchi added a comment - I'll improve the AbortException in the core to take the string argument, and have the catcher report that into the log. Once that's in place, I recommend the the nunit and cppunit plugin to just replace hudson.maven.agent.AbortException by hudson.AbortException. The checkstyle and tasks plugin should be able to do the same, too, and there won't be a need for anyone to define their own AbortException classes.

          Code changed in hudson
          User: : kohsuke
          Path:
          trunk/hudson/main/core/src/main/java/hudson/AbortException.java
          trunk/hudson/main/core/src/main/java/hudson/tasks/junit/JUnitResultArchiver.java
          trunk/hudson/main/maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
          trunk/hudson/main/maven-plugin/src/main/java/hudson/maven/MavenProcessFactory.java
          trunk/hudson/main/maven-plugin/src/main/java/hudson/maven/MavenUtil.java
          http://fisheye4.cenqua.com/changelog/hudson/?cs=16904
          Log:
          improved AbortException so that it can record the error message. Necessary for plugins like nunit and cppunit as discussed in JENKINS-3427.
          This should be in 1.298.

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : kohsuke Path: trunk/hudson/main/core/src/main/java/hudson/AbortException.java trunk/hudson/main/core/src/main/java/hudson/tasks/junit/JUnitResultArchiver.java trunk/hudson/main/maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java trunk/hudson/main/maven-plugin/src/main/java/hudson/maven/MavenProcessFactory.java trunk/hudson/main/maven-plugin/src/main/java/hudson/maven/MavenUtil.java http://fisheye4.cenqua.com/changelog/hudson/?cs=16904 Log: improved AbortException so that it can record the error message. Necessary for plugins like nunit and cppunit as discussed in JENKINS-3427 . This should be in 1.298.

          Code changed in hudson
          User: : redsolo
          Path:
          trunk/hudson/plugins/nunit/pom.xml
          trunk/hudson/plugins/nunit/src/main/java/hudson/plugins/nunit/NUnitPublisher.java
          http://fisheye4.cenqua.com/changelog/hudson/?cs=17066
          Log:
          [FIXED JENKINS-3427] Removed dependency to maven plugin, uses the AbortException in core instead.

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : redsolo Path: trunk/hudson/plugins/nunit/pom.xml trunk/hudson/plugins/nunit/src/main/java/hudson/plugins/nunit/NUnitPublisher.java http://fisheye4.cenqua.com/changelog/hudson/?cs=17066 Log: [FIXED JENKINS-3427] Removed dependency to maven plugin, uses the AbortException in core instead.

            redsolo redsolo
            pnyheim Paul Nyheim
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: