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

nunit plugin fails in hudson-1.296

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: nunit-plugin
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      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

        Attachments

          Issue Links

            Activity

            pnyheim Paul Nyheim created issue -
            Hide
            pnyheim Paul Nyheim added a comment -

            Created an attachment (id=648)
            quickfix to remove maven dependency from nunit plugin

            Show
            pnyheim Paul Nyheim added a comment - Created an attachment (id=648) quickfix to remove maven dependency from nunit plugin
            Hide
            pnyheim Paul Nyheim added a comment -

            I added a quickfix patch for this issue that I have rolled out in our
            environment.

            I've changed from using hudson.maven.agent.AbortException to hudson.AbortException instead.

            This might not be the perfect solution - as information about the
            TransformerException is not passed on to the Exception chain - because
            hudson.AbortException is missing the (string, exception) constructor.

            Show
            pnyheim Paul Nyheim added a comment - I added a quickfix patch for this issue that I have rolled out in our environment. I've changed from using hudson.maven.agent.AbortException to hudson.AbortException instead. This might not be the perfect solution - as information about the TransformerException is not passed on to the Exception chain - because hudson.AbortException is missing the (string, exception) constructor.
            Hide
            pnyheim Paul Nyheim added a comment -

            Created an attachment (id=650)
            quickfix to remove maven dependency from nunit plugin

            Show
            pnyheim Paul Nyheim added a comment - Created an attachment (id=650) quickfix to remove maven dependency from nunit plugin
            Hide
            pnyheim 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).

            Show
            pnyheim 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).
            Hide
            redsolo redsolo added a comment -

            Thanks for notifying me and providing a patch.

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

            Thanks for notifying me and providing a patch.

            Show
            redsolo redsolo added a comment - Thanks for notifying me and providing a patch.
            redsolo redsolo made changes -
            Field Original Value New Value
            Status Open [ 1 ] In Progress [ 3 ]
            Hide
            scm_issue_link 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

            Show
            scm_issue_link 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
            scm_issue_link SCM/JIRA link daemon made changes -
            Status In Progress [ 3 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            Hide
            kohsuke 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?

            Show
            kohsuke 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?
            kohsuke Kohsuke Kawaguchi made changes -
            Resolution Fixed [ 1 ]
            Status Resolved [ 5 ] Reopened [ 4 ]
            Hide
            kohsuke 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.

            Show
            kohsuke 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.
            kohsuke Kohsuke Kawaguchi made changes -
            Link This issue depends on JENKINS-3436 [ JENKINS-3436 ]
            Hide
            pnyheim 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

            Show
            pnyheim 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
            Hide
            kohsuke 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.

            Show
            kohsuke 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.
            Hide
            scm_issue_link 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.

            Show
            scm_issue_link 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.
            Hide
            scm_issue_link 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.

            Show
            scm_issue_link 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.
            scm_issue_link SCM/JIRA link daemon made changes -
            Status Reopened [ 4 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            abayer Andrew Bayer made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 133500 ] JNJira + In-Review [ 202205 ]

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: