Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-62988

ModelInterpreter.groovy unable to resolve class javax.annotation.Nonnull with Jenkins v2.235.1

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • Jenkins v2.235.1 upgraded from v2.222.4

      significant plugins:
      Git 4.3.0
      Pipeline 2.6
      Pipeline: Multibranch 2.21
      Pipeline: Declarative 1.7.0
      Pipeline: Groovy 2.81

      Jenkins server (windows, v2.222.4) was upgraded to latest version v2.235.1

      use a multibranch pipeline to git repo over proxy

      works well with v2.222.4

      crashs with v2.235.1

      only update Jenkins version, no plugin where updated

      significant error:

      hudson.remoting.ProxyException: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      jar:file:/C:/JenkinsServices/Testing/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy: 43: unable to resolve class javax.annotation.Nonnull
       @ line 43, column 1.
         import javax.annotation.Nonnull
         ^
      
      jar:file:/C:/JenkinsServices/Testing/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy: 42: unable to resolve class javax.annotation.CheckForNull
       @ line 42, column 1.
         import javax.annotation.CheckForNull
         ^
      
      jar:file:/C:/JenkinsServices/Testing/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy: 455: unable to resolve class javax.annotation.CheckForNull ,  unable to find class for annotation
       @ line 455, column 30.
             def withCredentialsBlock(@CheckForNull Environment environment, Closure body) {
                                      ^
      
      jar:file:/C:/JenkinsServices/Testing/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy: 493: unable to resolve class javax.annotation.Nonnull ,  unable to find class for annotation
       @ line 493, column 13.
                     @Nonnull Map<String, CredentialWrapper> credentials) {
                     ^
      

      plain.log:

      Branch indexing
       > git.exe rev-parse --is-inside-work-tree # timeout=10
      Setting origin to https://bitbucket.********.com/scm/repo.git
       > git.exe config remote.origin.url https://bitbucket.********.com/scm/repo.git # timeout=10
      Fetching origin...
      Fetching upstream changes from origin
       > git.exe --version # timeout=10
       > git.exe config --get remote.origin.url # timeout=10
      using GIT_ASKPASS to set credentials 
      Setting http proxy: proxy.******.com:8080
       > git.exe fetch --tags --force --progress -- origin +refs/heads/*:refs/remotes/origin/* # timeout=10
      Seen branch in repository origin/*****
      Seen branch in repository origin/*****
      Seen branch in repository origin/*****
      Seen branch in repository origin/*****
      Seen branch in repository origin/*****
      Seen branch in repository origin/*****
      Seen branch in repository origin/*****
      Seen branch in repository origin/master
      Seen 8 remote branches
      Obtained Jenkinsfile from 176574b083d6a80fc40b6d38342b0ea0c131e6ab
      Running in Durability level: MAX_SURVIVABILITY
      [Pipeline] Start of Pipeline
      [Pipeline] End of Pipeline
      hudson.remoting.ProxyException: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      jar:file:/C:/JenkinsServices/Testing/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy: 43: unable to resolve class javax.annotation.Nonnull
       @ line 43, column 1.
         import javax.annotation.Nonnull
         ^
      
      jar:file:/C:/JenkinsServices/Testing/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy: 42: unable to resolve class javax.annotation.CheckForNull
       @ line 42, column 1.
         import javax.annotation.CheckForNull
         ^
      
      jar:file:/C:/JenkinsServices/Testing/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy: 455: unable to resolve class javax.annotation.CheckForNull ,  unable to find class for annotation
       @ line 455, column 30.
             def withCredentialsBlock(@CheckForNull Environment environment, Closure body) {
                                      ^
      
      jar:file:/C:/JenkinsServices/Testing/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy: 493: unable to resolve class javax.annotation.Nonnull ,  unable to find class for annotation
       @ line 493, column 13.
                     @Nonnull Map<String, CredentialWrapper> credentials) {
                     ^
      
      4 errors
      
      	at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)
      	at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:958)
      	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:605)
      	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:554)
      	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
      	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
      	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:254)
      	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:250)
      	at groovy.lang.GroovyClassLoader.recompile(GroovyClassLoader.java:766)
      	at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:718)
      	at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:787)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:405)
      	at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell$TimingLoader.loadClass(CpsGroovyShell.java:170)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:405)
      	at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:677)
      	at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:787)
      	at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:775)
      	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelStepLoader.getValue(ModelStepLoader.java:60)
      	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:113)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
      	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:163)
      	at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23)
      	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:157)
      	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:142)
      	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:161)
      	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:165)
      	at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17)
      	at WorkflowScript.run(WorkflowScript:1)
      	at ___cps.transform___(Native Method)
      	at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:86)
      	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:113)
      	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:83)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
      	at com.cloudbees.groovy.cps.impl.ClosureBlock.eval(ClosureBlock.java:46)
      	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:129)
      	at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:268)
      	at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
      	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
      	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51)
      	at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:185)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:400)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:96)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:312)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:276)
      	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:131)
      	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
      	at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Finished: FAILURE
      

      .. and my job config:
      proxy config:

      multi branch pipeline config:

      and the JenkinsFile of master branch:

      pipeline
      {
        agent { label 'master' }
        stages
        {
          stage('Clean')
          {
            steps
            {
              bat "_clean.cmd"
            }
          }
          stage('Build')
          {
            steps
            {
              bat "_build.cmd"
              archiveArtifacts artifacts: '**/output/*', fingerprint: true, onlyIfSuccessful: true
            }
          }
          stage('FinalClean')
          {
            steps
            {
              bat "_clean.cmd"
            }
          }
        }
      }
      

      Jenkinsfile

        1. image-2020-07-07-11-10-34-527.png
          image-2020-07-07-11-10-34-527.png
          129 kB
        2. screenshot-1.png
          screenshot-1.png
          138 kB
        3. multi branch pipeline config.png
          multi branch pipeline config.png
          78 kB
        4. proxy config.png
          proxy config.png
          72 kB
        5. Jenkinsfile
          0.4 kB

            dnusbaum Devin Nusbaum
            thomaspatzig Thomas Patzig
            Votes:
            3 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: