java.lang.NoClassDefFoundError : Could not initialize class hudson. 工具.ProcessTree$UnixReflection

标签 java jenkins noclassdeffounderror

我在尝试使用 Jenkins 构建我的项目时遇到了这个问题: java.lang.NoClassDefFoundError: 无法初始化类 hudson.util.ProcessTree$UnixReflection。

java.lang.NoClassDefFoundError: Could not initialize class hudson.util.ProcessTree$UnixReflection
at hudson.util.ProcessTree$Unix.get(ProcessTree.java:506)
at hudson.util.ProcessTree.killAll(ProcessTree.java:144)
at hudson.Proc$LocalProc.destroy(Proc.java:380)
at hudson.Proc$LocalProc.join(Proc.java:353)
at hudson.tasks.CommandInterpreter.join(CommandInterpreter.java:155)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:109)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.Build$BuildExecution.build(Build.java:206)
at hudson.model.Build$BuildExecution.doRun(Build.java:163)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1728)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:405)

我已尝试将 JAVA JDK 1.8 降级到 1.7,但仍未解决问题。

这是一个 JavaScript 项目,测试通过但构建因该错误而失败。

你能帮帮我吗?

最佳答案

我们通过减少 jenkins stdout/stderr 输出来修复它。只需将调用命令的输出重定向到文件,然后重试。

在 Jenkins 团队修复它之前,这只是一种解决方法,但它对我们来说效果很好。

关于java.lang.NoClassDefFoundError : Could not initialize class hudson. 工具.ProcessTree$UnixReflection,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43726875/

相关文章:

java - 如何使用 Jsoup 提取 HTML 的单独部分?

jenkins - 如何禁用显示 "New version of Jenkins (2.62) is available for download (changelog)"?

java - 将 Spring Security 2.5 升级到 3.1 - java.lang.NoClassDefFoundError : org/springframework/security/Authentication

java - 尝试使用tomcat在servlet中加载dll时出现NoClassDefFoundError

xcode - 如何从 faSTLane 只运行一个 ui-test?

java - JBoss 5.1.0 企业版。随机出现 java.lang.NoClassDefFoundError

java - 在 Java 中使用 Aspose 单元动态创建工作表?

java - 将 Java Web Start 与 JavaFX 的 native bundle 结合使用

java - 带有@Pattern 的元注释在 Spring 不起作用

macos - 如何修复 Jenkins Slave 上的 SVN 结帐问题?