对 Jenkins 多分支管道配置进行任何更改时出现异常

Exception when making any change to Jenkins multibranch pipeline configuration

编辑:通过 Jenkins UI 对配置进行任何更改时会发生这种情况。直接更改配置 XML 文件工作正常。

向“Branch Sources”添加新分支曾经按预期工作。现在,当我添加分支并按保存时,出现以下异常。文件夹图标似乎有问题——与我正在尝试的内容没有直接关系。现在确定从这里去哪里。

Caught unhandled exception with ID 408ae4bf-39cd-4d36-b90b-66265c44bb65
java.lang.ClassNotFoundException: ["com.cloudbees.hudson.plugins.folder.icons.StockFolderIcon","jenkins.branch.MetadataActionFolderIcon"]
    at hudson.PluginManager$UberClassLoader.findClass(PluginManager.java:2173)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:681)
Caused: java.lang.IllegalArgumentException: Class ["com.cloudbees.hudson.plugins.folder.icons.StockFolderIcon","jenkins.branch.MetadataActionFolderIcon"] is specified in JSON, but no such class found in classLoader hudson.PluginManager$UberClassLoader
    at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:686)
Caused: java.lang.IllegalArgumentException: Failed to instantiate class com.cloudbees.hudson.plugins.folder.FolderIcon from {"stapler-class":["com.cloudbees.hudson.plugins.folder.icons.StockFolderIcon","jenkins.branch.MetadataActionFolderIcon"],"$class":["com.cloudbees.hudson.plugins.folder.icons.StockFolderIcon","jenkins.branch.MetadataActionFolderIcon"]}
    at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:693)
    at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:490)
    at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:486)
    at com.cloudbees.hudson.plugins.folder.AbstractFolder.doConfigSubmit(AbstractFolder.java:1360)
    at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.doConfigSubmit(ComputedFolder.java:414)
    at java.lang.invoke.MethodHandle.invokeWithArguments(Unknown Source)
    at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:393)
    at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:405)
    at org.kohsuke.stapler.interceptor.RequirePOST$Processor.invoke(RequirePOST.java:77)
    at org.kohsuke.stapler.PreInvokeInterceptedFunction.invoke(PreInvokeInterceptedFunction.java:26)
    at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:208)
    at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:141)
    at org.kohsuke.stapler.MetaClass.doDispatch(MetaClass.java:536)
    at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:766)
Caused: javax.servlet.ServletException
    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:816)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:898)
    at org.kohsuke.stapler.MetaClass.doDispatch(MetaClass.java:281)
    at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:766)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:898)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:694)
    at org.kohsuke.stapler.Stapler.service(Stapler.java:240)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

...

我在 Jenkins 2.303.2 上的 Jenkins 实例上也有类似的经历。通过转到 Dashboard -> Manage Jenkins -> Manage Plugins 并将 Folders 插件更新到最新版本来解决此问题。插件更新后,错误消失了,我能够保存多分支管道选项