升级后无法运行任何Jenkins管道

时间:2017-09-28 10:52:13

标签: jenkins jenkins-pipeline

在将一些与管道声明模型相关的插件从v1.1.9更新到v1.2之后,我甚至无法运行最简单的管道,而不是说我现有的所有管道都无法运行。

简单的管道就是例如

pipeline {
    agent any
    stages {
        stage('build') {
            steps {
                echo 'hello world'
            }
        }
    }
}

所有情况下的错误始终相同:

Started by user Roger
Obtained Jenkinsfile from git devops@code.careesma.net:chef-repo.git
[Pipeline] End of Pipeline
java.lang.ClassNotFoundException: java.util.function.Function
    at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1373)
    at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1326)
    at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1079)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2625)
    at java.lang.Class.privateGetPublicMethods(Class.java:2743)
    at java.lang.Class.getMethods(Class.java:1480)
    at java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1280)
    at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1141)
    at java.beans.Introspector.getBeanInfo(Introspector.java:416)
    at java.beans.Introspector.getBeanInfo(Introspector.java:163)
    at java.beans.Introspector.getBeanInfo(Introspector.java:250)
    at java.beans.Introspector.<init>(Introspector.java:397)
    at java.beans.Introspector.getBeanInfo(Introspector.java:163)
    at groovy.lang.MetaClassImpl$15.run(MetaClassImpl.java:3290)
    at java.security.AccessController.doPrivileged(Native Method)
    at groovy.lang.MetaClassImpl.addProperties(MetaClassImpl.java:3288)
    at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:3265)
    at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:254)
    at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:285)
    at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:258)
    at org.codehaus.groovy.runtime.InvokerHelper.getMetaClass(InvokerHelper.java:881)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallConstructorSite(CallSiteArray.java:87)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
    at org.kohsuke.groovy.sandbox.impl.Checker$3.call(Checker.java:198)
    at org.kohsuke.groovy.sandbox.GroovyInterceptor.onNewInstance(GroovyInterceptor.java:42)
    at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onNewInstance(SandboxInterceptor.java:146)
    at org.kohsuke.groovy.sandbox.impl.Checker$3.call(Checker.java:195)
    at org.kohsuke.groovy.sandbox.impl.Checker.checkedConstructor(Checker.java:200)
    at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.constructorCall(SandboxInvoker.java:21)
Caused: java.lang.NoClassDefFoundError: java/util/function/Function
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2625)
    at java.lang.Class.privateGetPublicMethods(Class.java:2743)
    at java.lang.Class.getMethods(Class.java:1480)
    at java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1280)
    at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1141)
    at java.beans.Introspector.getBeanInfo(Introspector.java:416)
    at java.beans.Introspector.getBeanInfo(Introspector.java:163)
    at java.beans.Introspector.getBeanInfo(Introspector.java:250)
    at java.beans.Introspector.<init>(Introspector.java:397)
    at java.beans.Introspector.getBeanInfo(Introspector.java:163)
    at groovy.lang.MetaClassImpl$15.run(MetaClassImpl.java:3290)
    at java.security.AccessController.doPrivileged(Native Method)
    at groovy.lang.MetaClassImpl.addProperties(MetaClassImpl.java:3288)
    at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:3265)
    at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:254)
    at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:285)
    at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:258)
    at org.codehaus.groovy.runtime.InvokerHelper.getMetaClass(InvokerHelper.java:881)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallConstructorSite(CallSiteArray.java:87)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
    at org.kohsuke.groovy.sandbox.impl.Checker$3.call(Checker.java:198)
    at org.kohsuke.groovy.sandbox.GroovyInterceptor.onNewInstance(GroovyInterceptor.java:42)
    at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onNewInstance(SandboxInterceptor.java:146)
    at org.kohsuke.groovy.sandbox.impl.Checker$3.call(Checker.java:195)
    at org.kohsuke.groovy.sandbox.impl.Checker.checkedConstructor(Checker.java:200)
    at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.constructorCall(SandboxInvoker.java:21)
    at WorkflowScript.run(WorkflowScript)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.call(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:54)
    at WorkflowScript.run(WorkflowScript:1)
    at ___cps.transform___(Native Method)
    at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:96)
    at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82)
    at sun.reflect.GeneratedMethodAccessor551.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
    at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
    at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
    at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
    at com.cloudbees.groovy.cps.Next.step(Next.java:83)
    at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)
    at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
    at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:122)
    at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:261)
    at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
    at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:19)
    at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:35)
    at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:32)
    at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
    at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:32)
    at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:330)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:82)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:242)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:230)
    at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
    at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Finished: FAILURE

插件页面中有关于正在运行的作业的警告,但没有任何关于破坏语法的信息。 https://wiki.jenkins.io/display/JENKINS/Pipeline+Model+Definition+Plugin

知道怎么解决吗?

1 个答案:

答案 0 :(得分:1)

Function接口是在Java 8中引入的。所以它像重新运行Java 8一样运行。如果您使用任何旧版本,请尝试升级它。