nunit plugin fails in hudson-1.296

Details

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

Kohsuke Kawaguchi
added a comment - 2009-04-06 15:37 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.

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 - 2009-04-07 00:42 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 - 2009-04-07 08:48 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.javahttp://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 - 2009-04-07 09:03 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.