灵风丶泣
2022-04-15 14:43
采纳率: 100%
浏览 244
已结题

jenkins升级版本后构建项目失败

问题遇到的现象和发生背景

公司内网的jenkins最近升级版本,升级到最新的2.343后构建项目失败

FATAL: org/apache/commons/digester/Digester
java.lang.ClassNotFoundException: org.apache.commons.digester.Digester
at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1402)
at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1357)
at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1112)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
Caused: java.lang.NoClassDefFoundError: org/apache/commons/digester/Digester
at hudson.scm.SubversionSCM.createChangeLogParser(SubversionSCM.java:1356)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:658)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:85)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:519)
at hudson.model.Run.execute(Run.java:1897)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
at hudson.model.ResourceController.execute(ResourceController.java:101)
at hudson.model.Executor.run(Executor.java:442)
Finished: FAILURE

img

操作环境、软件版本等信息

内网服务器系统Windows server 2016
本机环境 win10
两个JDK都是11.0.5
测试时jenkins版本2.343
插件版本一致,直接从服务器拷到本机来的

尝试过的解决方法

一开始以为是版本问题,所以在本机搭建了一个环境,除了系统以外和服务器内的jenkins保持一致
然后发现本机的可以构建成功

img

之后怀疑是升级方式不对,原本替换jenk.war,更改为安装升级,还有卸载重新搭建,但是都不行,报错与最上方一致

之后根据报错去寻求解决方案,在jenkins.war中加入了commons-digester-1.8.jar

img


构建项目依旧失败,报错变了

java.lang.ClassNotFoundException: hudson.util.Digester2
at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1402)
at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1357)
at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1112)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
Caused: java.lang.NoClassDefFoundError: hudson/util/Digester2
at hudson.scm.SubversionSCM.createChangeLogParser(SubversionSCM.java:1356)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:658)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:85)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:519)
at hudson.model.Run.execute(Run.java:1897)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
at hudson.model.ResourceController.execute(ResourceController.java:101)
at hudson.model.Executor.run(Executor.java:442)
Finished: FAILURE

img

然后回滚到jenkins2.289.3就可以构建成功

求指点

我想要达到的结果

升级到2.343可以构建项目成功

4条回答 默认 最新

相关推荐 更多相似问题