Hudson 开始因 ClassNotFoundException 而失败

Hudson 开始因 ClassNotFoundException 而失败

从今天起,Hudson 中的 Maven 构建开始失败,并出现以下堆栈跟踪:

Parsing POMs
[workspace] $ /usr/lib/jvm/java-6-sun/bin/java -cp /usr/share/tomcat5.5/.hudson/plugins/maven-plugin/WEB-INF/lib/maven-agent-1.377.jar:/usr/share/maven2/boot/classworlds.jar hudson.maven.agent.Main /usr/share/maven2 /var/lib/tomcat5.5/webapps/hudson/WEB-INF/lib/remoting-1.377.jar /usr/share/tomcat5.5/.hudson/plugins/maven-plugin/WEB-INF/lib/maven-interceptor-1.377.jar 37299
<===[HUDSON REMOTING CAPACITY]===>���channel started
channel stopped
ERROR: Failed to parse POMs
java.io.IOException: Remote call on Channel to Maven [/usr/lib/jvm/java-6-sun/bin/java, -cp, /usr/share/tomcat5.5/.hudson/plugins/maven-plugin/WEB-INF/lib/maven-agent-1.377.jar:/usr/share/maven2/boot/classworlds.jar, hudson.maven.agent.Main, /usr/share/maven2, /var/lib/tomcat5.5/webapps/hudson/WEB-INF/lib/remoting-1.377.jar, /usr/share/tomcat5.5/.hudson/plugins/maven-plugin/WEB-INF/lib/maven-interceptor-1.377.jar, 37299] failed
 at hudson.remoting.Channel.call(Channel.java:566)
 at hudson.maven.ProcessCache$MavenProcess.call(ProcessCache.java:156)
 at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:468)
 at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:416)
 at hudson.model.Run.run(Run.java:1273)
 at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:291)
 at hudson.model.ResourceController.execute(ResourceController.java:88)
 at hudson.model.Executor.run(Executor.java:137)
Caused by: java.lang.NoClassDefFoundError: hudson/maven/agent/PluginManagerInterceptor
 at hudson.maven.MavenBuilder.call(MavenBuilder.java:218)
 at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:681)
 at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:625)
 at hudson.remoting.UserRequest.perform(UserRequest.java:114)
 at hudson.remoting.UserRequest.perform(UserRequest.java:48)
 at hudson.remoting.Request$2.run(Request.java:270)
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 at java.lang.Thread.run(Thread.java:619)

有任何想法吗?

答案1

我在 Hudson 构建从属服务器上见过几次这种情况。我不确定根本原因是什么,但删除工作区并让 Hudson 重建它,特别是重新下载 Java 似乎有效。

当然,如果这发生在主节点上,那对你没有太大帮助。

答案2

您的 maven 插件版本是否与 hudson 版本同步?我还会检查您是否可以从命令行构建项目。正如 dsolimano 所说,他清除了工作区。不确定重新下载 java 是否适合这种情况。

我没有遇到过这种情况,因为我从未在 SCM 中使用更新。我在使用 subversion 更新时遇到了问题。我们无法找到根本原因(可能是时钟不同步),但对于我们来说,修复方法始终是删除整个源文件夹并下载整个项目。因此,我们总是从头开始运行干净的构建。

相关内容