问题描述
我有一个问题:(正在等待-等待下一个可用的执行程序)
控制台日志:
Timer task hudson.model.Queue$MaintainTask@fb3e676 failed
java.lang.ClassCastException: class java.lang.Integer cannot be cast to class hudson.slaves.NodeProperty (java.lang.Integer is in module java.base of loader 'bootstrap'; hudson.slaves.NodeProperty is in unnamed module of loader org.eclipse.jetty.webapp.WebAppClassLoader @7364985f)
at hudson.model.Node.canTake(Node.java:409)
at hudson.model.Queue$JobOffer.getCauseOfBlockage(Queue.java:276)
at hudson.model.Queue.maintain(Queue.java:1633)
at hudson.model.Queue$MaintainTask.doRun(Queue.java:2904)
at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:91)
at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:58)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
解决方法
这似乎与Jenkins错误有关:FATAL: java.lang.Integer cannot be cast to hudson.slaves.NodeProperty。您最近升级了詹金斯吗?
- 转到您的Jenkins安装目录的根文件夹。
- 在
config.xml
中寻找<globalNodeProperties>
- 如果看起来像这样,则可能是未正确升级:
<globalNodeProperties>
<hudson.slaves.EnvironmentVariablesNodeProperty/>
<int>2</int>
<string></string>
<string></string>
...
</globalNodeProperties>
- XML格式已更改,看起来应该像这样(注意
int
不再是globalNodeProperty
,也就是您所得到的例外:
<globalNodeProperties>
<hudson.slaves.EnvironmentVariablesNodeProperty>
<envVars serialization="custom">
<unserializable-parents/>
<tree-map>
<default>
<comparator class="hudson.util.CaseInsensitiveComparator" reference="../../../../../../views/listView/jobNames/comparator"/>
</default>
<int>2</int>
<string></string>
<string></string>
...
</tree-map>
</envVars>
</hudson.slaves.EnvironmentVariablesNodeProperty>
</globalNodeProperties>