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

Calling super to CPS-transformed methods fails with CpsCallableInvocation

    XMLWordPrintable

Details

    • Pipeline - April 2018

    Description

      From comment for JENKINS-42563:

      Only super calls to native methods were tested IIRC. Support for super calls to CPS-transformed methods is another matter entirely. Probably a subject for a separate bug report.

      From original issue JENKINS-42563 (please find below a more recent update comment and a smaller reproducer without need of a shared library):

      My goal was to create some abstractions in shared (global pipeline) library so that in the Jenkinsfile I only have the configuration of the build, whereas the re-usable build script logic is fully in the library; so very much like the Section https://jenkins.io/doc/book/pipeline/shared-libraries/#defining-a-more-structured-dsl.

      In the shared library I use simple class inheritance, but the call to a super method fails with CpsCallableInvocation.

      This is the stacktrace:

      hudson.remoting.ProxyException: org.codehaus.groovy.runtime.InvokerInvocationException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
          at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:100)
          at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
          at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1218)
          at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.superCall(DefaultInvoker.java:29)
          at com.acme.B1.build(file:/var/lib/jenkins/jobs/Pipeline-Using-Shared-Library/builds/187/libs/******-shared-library/src/com/acme/B1.groovy:21)
          at acme.b1(/var/lib/jenkins/jobs/Pipeline-Using-Shared-Library/builds/187/libs/******-shared-library/vars/acme.groovy:9)
          at WorkflowScript.run(WorkflowScript:18)
          at ___cps.transform___(Native Method)
          at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:54)
          at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
          at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82)
          at sun.reflect.GeneratedMethodAccessor273.invoke(Unknown Source)
          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:74)
          at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154)
          at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
          at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:33)
          at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:30)
          at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
          at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:30)
          at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:165)
          at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:328)
          at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:80)
          at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:240)
          at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:228)
          at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          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:511)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
          at java.lang.Thread.run(Thread.java:745)
      Caused by: hudson.remoting.ProxyException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
          at sun.reflect.GeneratedConstructorAccessor549.newInstance(Unknown Source)
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
          at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
          at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
          at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:263)
          at com.acme.B1.build(B1.groovy)
          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:1218)
          at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.superCall(DefaultInvoker.java:29)
          ... 29 more

      This is the build console output, before the aforementioned problem:

      [Pipeline] echo
      Pipeline Script using shared library
      [Pipeline] echo
      from Jenkinsfile via "acme.b0"
      [Pipeline] echo
      from C1.build: name from Jenkinsfile via "acme.c1"
      [Pipeline] End of Pipeline
      // And then would be the aforementioned stacktrace output
      

      And at long last, this is the code:

      Jenkinsfile
      #!/usr/bin/env groovy
      
      echo 'Pipeline Script using shared library'
      
      @Library('******-shared-library@branches/*************') _
      
      acme.b0 {
        echo 'from Jenkinsfile via "acme.b0"'
      }
      
      acme.c1 {
        name = 'name from Jenkinsfile via "acme.c1"'
      }
      
      // This does not work:
      acme.b1 {
        name = 'name from Jenkinsfile via "acme.b1"'
      }
      
      vars/acme.groovy
      #!/usr/bin/env groovy
      
      void b0(Closure body) {
        def b0 = new com.acme.B0()
        b0.build(body)
      }
      
      void b1(Closure configBody) {
        def b1 = new com.acme.B1(this)
        b1.build(configBody)
      }
      
      void c1(Closure configBody) {
        def c1 = new com.acme.C1(this)
        c1.build(configBody)
      }
      
      src/com/acme/B0.groovy
      #!/usr/bin/env groovy
      
      package com.acme
      
      class B0 implements Serializable {
      
        public void build(Closure body) {
          body()
        }
      
      }
      
      src/com/acme/B1.groovy
      #!/usr/bin/env groovy
      
      package com.acme
      
      class B1 extends B0 {
      
        def script
      
        B1(def script) {
          this.script = script
        }
      
        public void build(Closure configBody) {
          // First evaluate the body configuration block, and collect configuration into the object:
          def config = [:]
          configBody.resolveStrategy = Closure.DELEGATE_FIRST
          configBody.delegate = config
          configBody()
      
          // Then build, based on the configuration provided:
          super.build() { // !!! This is line #21 where the problem occurs
            script.echo "from B1.build: ${config.name}"
          }
        }
      
      }
      
      src/com/acme/C1.groovy
      #!/usr/bin/env groovy
      
      package com.acme
      
      class C1 implements Serializable {
      
        def script
        def acme
      
        C1(def script) {
          this.script = script
          this.acme = script.acme
        }
      
        public void build(Closure configBody) {
          // First evaluate the body configuration block, and collect configuration into the object:
          def config = [:]
          configBody.resolveStrategy = Closure.DELEGATE_FIRST
          configBody.delegate = config
          configBody()
      
          // Then build, based on the configuration provided:
          acme.b0 {
            script.echo "from C1.build: ${config.name}"
          }
        }
      
      }
      

      Please mind: In this case the approach via acme.c1 and com.acme.C1 calling acme.b0 step is the workaround for the problem...

      Based on the minimal pipeline script example of pmilliken in JENKINS-42563 it still fails:

      • Installed pipeline plugin versions:
        pipeline-model-api: 1.1.9
        pipeline-build-step: 2.5.1
        pipeline-model-definition: 1.1.9
        pipeline-milestone-step: 1.3.1
        pipeline-model-declarative-agent: 1.1.1
        pipeline-stage-step: 2.2
        pipeline-model-extensions: 1.1.9
        script-security: 1.30
        workflow-aggregator: 2.5
        workflow-api: 2.20
        workflow-job: 2.14
        workflow-support: 2.14
        workflow-step-api: 2.12
        workflow-basic-steps: 2.6
        workflow-cps-global-lib: 2.8
        workflow-cps: 2.38
        blueocean: 1.1.5
        blueocean-pipeline-api-impl: 1.1.5
        
      • Pipeline code:
        class A {
          def script2
          A(script) { script2 = script }
          def test(script) {
            script.echo "In A"
          }
          def testWithoutArgs() {
            script2.echo "In A without args"
          }
        }
        
        class B extends A {
          B(script) { super(script) }
          def test(script) {
            script.echo "In B"
            super.test(script)
          }
          def testWithoutArgs() {
            script2.echo "In B without args"
            super.testWithoutArgs()
          }
        }
        
        node {
        
          stage('A without args') {
            new A(this).testWithoutArgs()
          }
        
          stage('A') {
            new A(this).test(this)
          }
        
          stage('B without args') {
            new B(this).testWithoutArgs()
          }
          
          stage('B') {
            new B(this).test(this)
          }
        
        }
        
      • Build log with disabled sandbox option:
        [Pipeline] node
        Running on master in /var/lib/jenkins/workspace/Sandbox/JENKINS-42563
        [Pipeline] {
        [Pipeline] stage
        [Pipeline] { (A without args)
        [Pipeline] echo
        In A without args
        [Pipeline] }
        [Pipeline] // stage
        [Pipeline] stage
        [Pipeline] { (A)
        [Pipeline] echo
        In A
        [Pipeline] }
        [Pipeline] // stage
        [Pipeline] stage
        [Pipeline] { (B without args)
        [Pipeline] echo
        In B without args
        [Pipeline] }
        [Pipeline] // stage
        [Pipeline] }
        [Pipeline] // node
        [Pipeline] End of Pipeline
        hudson.remoting.ProxyException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
        	at sun.reflect.GeneratedConstructorAccessor143.newInstance(Unknown Source)
        	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
        	at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
        	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
        	at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:110)
        	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:263)
        	at A.testWithoutArgs(WorkflowScript)
        	at B.super$2$testWithoutArgs(WorkflowScript)
        	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 com.cloudbees.groovy.cps.sandbox.DefaultInvoker.superCall(DefaultInvoker.java:29)
        Caused: hudson.remoting.ProxyException: org.codehaus.groovy.runtime.InvokerInvocationException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
        	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:100)
        	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
        	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
        	at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.superCall(DefaultInvoker.java:29)
        	at B.testWithoutArgs(WorkflowScript:20)
        	at WorkflowScript.run(WorkflowScript:35)
        	at ___cps.transform___(Native Method)
        	at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:54)
        	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
        	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixName(FunctionCallBlock.java:77)
        	at sun.reflect.GeneratedMethodAccessor190.invoke(Unknown Source)
        	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.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:173)
        	at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:162)
        	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:162)
        	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:266)
        	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: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
        
      • Log with enabled sandbox option:
        [Pipeline] node
        Running on master in /var/lib/jenkins/workspace/Sandbox/JENKINS-42563
        [Pipeline] {
        [Pipeline] stage
        [Pipeline] { (A without args)
        [Pipeline] echo
        In A without args
        [Pipeline] }
        [Pipeline] // stage
        [Pipeline] stage
        [Pipeline] { (A)
        [Pipeline] echo
        In A
        [Pipeline] }
        [Pipeline] // stage
        [Pipeline] stage
        [Pipeline] { (B without args)
        [Pipeline] echo
        In B without args
        [Pipeline] }
        [Pipeline] // stage
        [Pipeline] }
        [Pipeline] // node
        [Pipeline] End of Pipeline
        hudson.remoting.ProxyException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
        	at sun.reflect.GeneratedConstructorAccessor143.newInstance(Unknown Source)
        	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
        	at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
        	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
        	at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:110)
        	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:263)
        	at A.testWithoutArgs(WorkflowScript)
        	at B.super$2$testWithoutArgs(WorkflowScript)
        	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 org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:207)
        	at org.kohsuke.groovy.sandbox.GroovyInterceptor.onSuperCall(GroovyInterceptor.java:49)
        	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onSuperCall(SandboxInterceptor.java:380)
        	at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:204)
        	at org.kohsuke.groovy.sandbox.impl.Checker.checkedSuperCall(Checker.java:210)
        	at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.superCall(SandboxInvoker.java:24)
        Caused: hudson.remoting.ProxyException: org.codehaus.groovy.runtime.InvokerInvocationException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
        	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:100)
        	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
        	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
        	at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:207)
        	at org.kohsuke.groovy.sandbox.GroovyInterceptor.onSuperCall(GroovyInterceptor.java:49)
        	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onSuperCall(SandboxInterceptor.java:380)
        	at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:204)
        	at org.kohsuke.groovy.sandbox.impl.Checker.checkedSuperCall(Checker.java:210)
        	at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.superCall(SandboxInvoker.java:24)
        	at B.testWithoutArgs(WorkflowScript:20)
        	at WorkflowScript.run(WorkflowScript:35)
        	at ___cps.transform___(Native Method)
        	at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:54)
        	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
        	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixName(FunctionCallBlock.java:77)
        	at sun.reflect.GeneratedMethodAccessor190.invoke(Unknown Source)
        	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.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:173)
        	at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:162)
        	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:162)
        	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:266)
        	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: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
        

      Attachments

        Issue Links

          Activity

            reinholdfuereder Reinhold Füreder created issue -
            reinholdfuereder Reinhold Füreder made changes -
            Field Original Value New Value
            Epic Link JENKINS-35390 [ 171183 ]
            reinholdfuereder Reinhold Füreder made changes -
            Component/s workflow-cps-plugin [ 21713 ]
            Component/s script-security-plugin [ 18520 ]
            Description My goal was to create some abstractions in shared (global pipeline) library so that in the Jenkinsfile I only have the configuration of the build, whereas the re-usable build script logic is fully in the library; so very much like the Section [https://jenkins.io/doc/book/pipeline/shared-libraries/#defining-a-more-structured-dsl.]

            In the shared library I use simple class inheritance, but the call to a super method fails with CpsCallableInvocation.

            This is the stacktrace:
            {noformat}
            hudson.remoting.ProxyException: org.codehaus.groovy.runtime.InvokerInvocationException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
                at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:100)
                at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
                at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1218)
                at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.superCall(DefaultInvoker.java:29)
                at com.acme.B1.build(file:/var/lib/jenkins/jobs/Pipeline-Using-Shared-Library/builds/187/libs/******-shared-library/src/com/acme/B1.groovy:21)
                at acme.b1(/var/lib/jenkins/jobs/Pipeline-Using-Shared-Library/builds/187/libs/******-shared-library/vars/acme.groovy:9)
                at WorkflowScript.run(WorkflowScript:18)
                at ___cps.transform___(Native Method)
                at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:54)
                at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
                at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82)
                at sun.reflect.GeneratedMethodAccessor273.invoke(Unknown Source)
                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:74)
                at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154)
                at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
                at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:33)
                at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:30)
                at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
                at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:30)
                at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:165)
                at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:328)
                at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:80)
                at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:240)
                at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:228)
                at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                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:511)
                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
                at java.lang.Thread.run(Thread.java:745)
            Caused by: hudson.remoting.ProxyException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
                at sun.reflect.GeneratedConstructorAccessor549.newInstance(Unknown Source)
                at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
                at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
                at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
                at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
                at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:263)
                at com.acme.B1.build(B1.groovy)
                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:1218)
                at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.superCall(DefaultInvoker.java:29)
                ... 29 more{noformat}
            This is the build console output, before the aforementioned problem:
            {noformat}
            [Pipeline] echo
            Pipeline Script using shared library
            [Pipeline] echo
            from Jenkinsfile via "acme.b0"
            [Pipeline] echo
            from C1.build: name from Jenkinsfile via "acme.c1"
            [Pipeline] End of Pipeline
            // And then would be the aforementioned stacktrace output
            {noformat}
            And at long last, this is the code:
            {code:java|title=Jenkinsfile}
            #!/usr/bin/env groovy

            echo 'Pipeline Script using shared library'

            @Library('******-shared-library@branches/*************') _

            acme.b0 {
              echo 'from Jenkinsfile via "acme.b0"'
            }

            acme.c1 {
              name = 'name from Jenkinsfile via "acme.c1"'
            }

            // This does not work:
            acme.b1 {
              name = 'name from Jenkinsfile via "acme.b1"'
            }
            {code}
            {code:java|title=vars/acme.groovy}
            #!/usr/bin/env groovy

            void b0(Closure body) {
              def b0 = new com.acme.B0()
              b0.build(body)
            }

            void b1(Closure configBody) {
              def b1 = new com.acme.B1(this)
              b1.build(configBody)
            }

            void c1(Closure configBody) {
              def c1 = new com.acme.C1(this)
              c1.build(configBody)
            }
            {code}
            {code:java|title=src/com/acme/B0.groovy}
            #!/usr/bin/env groovy

            package com.acme

            class B0 implements Serializable {

              public void build(Closure body) {
                body()
              }

            }
            {code}
            {code:java|title=src/com/acme/B1.groovy}
            #!/usr/bin/env groovy

            package com.acme

            class B1 extends B0 {

              def script

              B1(def script) {
                this.script = script
              }

              public void build(Closure configBody) {
                // First evaluate the body configuration block, and collect configuration into the object:
                def config = [:]
                configBody.resolveStrategy = Closure.DELEGATE_FIRST
                configBody.delegate = config
                configBody()

                // Then build, based on the configuration provided:
                super.build() { // !!! This is line #21 where the problem occurs
                  script.echo "from B1.build: ${config.name}"
                }
              }

            }
            {code}
            {code:java|title=src/com/acme/C1.groovy}
            #!/usr/bin/env groovy

            package com.acme

            class C1 implements Serializable {

              def script
              def acme

              C1(def script) {
                this.script = script
                this.acme = script.acme
              }

              public void build(Closure configBody) {
                // First evaluate the body configuration block, and collect configuration into the object:
                def config = [:]
                configBody.resolveStrategy = Closure.DELEGATE_FIRST
                configBody.delegate = config
                configBody()

                // Then build, based on the configuration provided:
                acme.b0 {
                  script.echo "from C1.build: ${config.name}"
                }
              }

            }
            {code}

            Please mind: In this case the approach via {{acme.c1}} and {{com.acme.C1}} calling {{acme.b0}} step is the workaround for the problem...
            See JENKINS-42563:
            {quote}
            My goal was to create some abstractions in shared (global pipeline) library so that in the Jenkinsfile I only have the configuration of the build, whereas the re-usable build script logic is fully in the library; so very much like the Section [https://jenkins.io/doc/book/pipeline/shared-libraries/#defining-a-more-structured-dsl.]

            In the shared library I use simple class inheritance, but the call to a super method fails with CpsCallableInvocation.

            This is the stacktrace:
            {noformat}
            hudson.remoting.ProxyException: org.codehaus.groovy.runtime.InvokerInvocationException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
                at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:100)
                at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
                at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1218)
                at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.superCall(DefaultInvoker.java:29)
                at com.acme.B1.build(file:/var/lib/jenkins/jobs/Pipeline-Using-Shared-Library/builds/187/libs/******-shared-library/src/com/acme/B1.groovy:21)
                at acme.b1(/var/lib/jenkins/jobs/Pipeline-Using-Shared-Library/builds/187/libs/******-shared-library/vars/acme.groovy:9)
                at WorkflowScript.run(WorkflowScript:18)
                at ___cps.transform___(Native Method)
                at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:54)
                at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
                at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82)
                at sun.reflect.GeneratedMethodAccessor273.invoke(Unknown Source)
                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:74)
                at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154)
                at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
                at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:33)
                at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:30)
                at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
                at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:30)
                at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:165)
                at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:328)
                at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:80)
                at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:240)
                at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:228)
                at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                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:511)
                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
                at java.lang.Thread.run(Thread.java:745)
            Caused by: hudson.remoting.ProxyException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
                at sun.reflect.GeneratedConstructorAccessor549.newInstance(Unknown Source)
                at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
                at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
                at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
                at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
                at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:263)
                at com.acme.B1.build(B1.groovy)
                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:1218)
                at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.superCall(DefaultInvoker.java:29)
                ... 29 more{noformat}
            This is the build console output, before the aforementioned problem:
            {noformat}
            [Pipeline] echo
            Pipeline Script using shared library
            [Pipeline] echo
            from Jenkinsfile via "acme.b0"
            [Pipeline] echo
            from C1.build: name from Jenkinsfile via "acme.c1"
            [Pipeline] End of Pipeline
            // And then would be the aforementioned stacktrace output
            {noformat}
            And at long last, this is the code:
            {code:java|title=Jenkinsfile}
            #!/usr/bin/env groovy

            echo 'Pipeline Script using shared library'

            @Library('******-shared-library@branches/*************') _

            acme.b0 {
              echo 'from Jenkinsfile via "acme.b0"'
            }

            acme.c1 {
              name = 'name from Jenkinsfile via "acme.c1"'
            }

            // This does not work:
            acme.b1 {
              name = 'name from Jenkinsfile via "acme.b1"'
            }
            {code}
            {code:java|title=vars/acme.groovy}
            #!/usr/bin/env groovy

            void b0(Closure body) {
              def b0 = new com.acme.B0()
              b0.build(body)
            }

            void b1(Closure configBody) {
              def b1 = new com.acme.B1(this)
              b1.build(configBody)
            }

            void c1(Closure configBody) {
              def c1 = new com.acme.C1(this)
              c1.build(configBody)
            }
            {code}
            {code:java|title=src/com/acme/B0.groovy}
            #!/usr/bin/env groovy

            package com.acme

            class B0 implements Serializable {

              public void build(Closure body) {
                body()
              }

            }
            {code}
            {code:java|title=src/com/acme/B1.groovy}
            #!/usr/bin/env groovy

            package com.acme

            class B1 extends B0 {

              def script

              B1(def script) {
                this.script = script
              }

              public void build(Closure configBody) {
                // First evaluate the body configuration block, and collect configuration into the object:
                def config = [:]
                configBody.resolveStrategy = Closure.DELEGATE_FIRST
                configBody.delegate = config
                configBody()

                // Then build, based on the configuration provided:
                super.build() { // !!! This is line #21 where the problem occurs
                  script.echo "from B1.build: ${config.name}"
                }
              }

            }
            {code}
            {code:java|title=src/com/acme/C1.groovy}
            #!/usr/bin/env groovy

            package com.acme

            class C1 implements Serializable {

              def script
              def acme

              C1(def script) {
                this.script = script
                this.acme = script.acme
              }

              public void build(Closure configBody) {
                // First evaluate the body configuration block, and collect configuration into the object:
                def config = [:]
                configBody.resolveStrategy = Closure.DELEGATE_FIRST
                configBody.delegate = config
                configBody()

                // Then build, based on the configuration provided:
                acme.b0 {
                  script.echo "from C1.build: ${config.name}"
                }
              }

            }
            {code}

            Please mind: In this case the approach via {{acme.c1}} and {{com.acme.C1}} calling {{acme.b0}} step is the workaround for the problem...
            {quote}
            reinholdfuereder Reinhold Füreder made changes -
            Link This issue is related to JENKINS-42563 [ JENKINS-42563 ]
            reinholdfuereder Reinhold Füreder made changes -
            Description See JENKINS-42563:
            {quote}
            My goal was to create some abstractions in shared (global pipeline) library so that in the Jenkinsfile I only have the configuration of the build, whereas the re-usable build script logic is fully in the library; so very much like the Section [https://jenkins.io/doc/book/pipeline/shared-libraries/#defining-a-more-structured-dsl.]

            In the shared library I use simple class inheritance, but the call to a super method fails with CpsCallableInvocation.

            This is the stacktrace:
            {noformat}
            hudson.remoting.ProxyException: org.codehaus.groovy.runtime.InvokerInvocationException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
                at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:100)
                at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
                at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1218)
                at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.superCall(DefaultInvoker.java:29)
                at com.acme.B1.build(file:/var/lib/jenkins/jobs/Pipeline-Using-Shared-Library/builds/187/libs/******-shared-library/src/com/acme/B1.groovy:21)
                at acme.b1(/var/lib/jenkins/jobs/Pipeline-Using-Shared-Library/builds/187/libs/******-shared-library/vars/acme.groovy:9)
                at WorkflowScript.run(WorkflowScript:18)
                at ___cps.transform___(Native Method)
                at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:54)
                at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
                at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82)
                at sun.reflect.GeneratedMethodAccessor273.invoke(Unknown Source)
                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:74)
                at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154)
                at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
                at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:33)
                at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:30)
                at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
                at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:30)
                at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:165)
                at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:328)
                at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:80)
                at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:240)
                at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:228)
                at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                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:511)
                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
                at java.lang.Thread.run(Thread.java:745)
            Caused by: hudson.remoting.ProxyException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
                at sun.reflect.GeneratedConstructorAccessor549.newInstance(Unknown Source)
                at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
                at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
                at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
                at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
                at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:263)
                at com.acme.B1.build(B1.groovy)
                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:1218)
                at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.superCall(DefaultInvoker.java:29)
                ... 29 more{noformat}
            This is the build console output, before the aforementioned problem:
            {noformat}
            [Pipeline] echo
            Pipeline Script using shared library
            [Pipeline] echo
            from Jenkinsfile via "acme.b0"
            [Pipeline] echo
            from C1.build: name from Jenkinsfile via "acme.c1"
            [Pipeline] End of Pipeline
            // And then would be the aforementioned stacktrace output
            {noformat}
            And at long last, this is the code:
            {code:java|title=Jenkinsfile}
            #!/usr/bin/env groovy

            echo 'Pipeline Script using shared library'

            @Library('******-shared-library@branches/*************') _

            acme.b0 {
              echo 'from Jenkinsfile via "acme.b0"'
            }

            acme.c1 {
              name = 'name from Jenkinsfile via "acme.c1"'
            }

            // This does not work:
            acme.b1 {
              name = 'name from Jenkinsfile via "acme.b1"'
            }
            {code}
            {code:java|title=vars/acme.groovy}
            #!/usr/bin/env groovy

            void b0(Closure body) {
              def b0 = new com.acme.B0()
              b0.build(body)
            }

            void b1(Closure configBody) {
              def b1 = new com.acme.B1(this)
              b1.build(configBody)
            }

            void c1(Closure configBody) {
              def c1 = new com.acme.C1(this)
              c1.build(configBody)
            }
            {code}
            {code:java|title=src/com/acme/B0.groovy}
            #!/usr/bin/env groovy

            package com.acme

            class B0 implements Serializable {

              public void build(Closure body) {
                body()
              }

            }
            {code}
            {code:java|title=src/com/acme/B1.groovy}
            #!/usr/bin/env groovy

            package com.acme

            class B1 extends B0 {

              def script

              B1(def script) {
                this.script = script
              }

              public void build(Closure configBody) {
                // First evaluate the body configuration block, and collect configuration into the object:
                def config = [:]
                configBody.resolveStrategy = Closure.DELEGATE_FIRST
                configBody.delegate = config
                configBody()

                // Then build, based on the configuration provided:
                super.build() { // !!! This is line #21 where the problem occurs
                  script.echo "from B1.build: ${config.name}"
                }
              }

            }
            {code}
            {code:java|title=src/com/acme/C1.groovy}
            #!/usr/bin/env groovy

            package com.acme

            class C1 implements Serializable {

              def script
              def acme

              C1(def script) {
                this.script = script
                this.acme = script.acme
              }

              public void build(Closure configBody) {
                // First evaluate the body configuration block, and collect configuration into the object:
                def config = [:]
                configBody.resolveStrategy = Closure.DELEGATE_FIRST
                configBody.delegate = config
                configBody()

                // Then build, based on the configuration provided:
                acme.b0 {
                  script.echo "from C1.build: ${config.name}"
                }
              }

            }
            {code}

            Please mind: In this case the approach via {{acme.c1}} and {{com.acme.C1}} calling {{acme.b0}} step is the workaround for the problem...
            {quote}
            From original issue JENKINS-42563 (please find below a more recent update comment and a smaller reproducer without need of a shared library):
            {quote}
            My goal was to create some abstractions in shared (global pipeline) library so that in the Jenkinsfile I only have the configuration of the build, whereas the re-usable build script logic is fully in the library; so very much like the Section [https://jenkins.io/doc/book/pipeline/shared-libraries/#defining-a-more-structured-dsl.]

            In the shared library I use simple class inheritance, but the call to a super method fails with CpsCallableInvocation.

            This is the stacktrace:
            {noformat}
            hudson.remoting.ProxyException: org.codehaus.groovy.runtime.InvokerInvocationException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
                at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:100)
                at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
                at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1218)
                at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.superCall(DefaultInvoker.java:29)
                at com.acme.B1.build(file:/var/lib/jenkins/jobs/Pipeline-Using-Shared-Library/builds/187/libs/******-shared-library/src/com/acme/B1.groovy:21)
                at acme.b1(/var/lib/jenkins/jobs/Pipeline-Using-Shared-Library/builds/187/libs/******-shared-library/vars/acme.groovy:9)
                at WorkflowScript.run(WorkflowScript:18)
                at ___cps.transform___(Native Method)
                at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:54)
                at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
                at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82)
                at sun.reflect.GeneratedMethodAccessor273.invoke(Unknown Source)
                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:74)
                at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154)
                at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
                at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:33)
                at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:30)
                at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
                at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:30)
                at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:165)
                at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:328)
                at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:80)
                at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:240)
                at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:228)
                at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                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:511)
                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
                at java.lang.Thread.run(Thread.java:745)
            Caused by: hudson.remoting.ProxyException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
                at sun.reflect.GeneratedConstructorAccessor549.newInstance(Unknown Source)
                at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
                at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
                at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
                at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
                at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:263)
                at com.acme.B1.build(B1.groovy)
                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:1218)
                at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.superCall(DefaultInvoker.java:29)
                ... 29 more{noformat}
            This is the build console output, before the aforementioned problem:
            {noformat}
            [Pipeline] echo
            Pipeline Script using shared library
            [Pipeline] echo
            from Jenkinsfile via "acme.b0"
            [Pipeline] echo
            from C1.build: name from Jenkinsfile via "acme.c1"
            [Pipeline] End of Pipeline
            // And then would be the aforementioned stacktrace output
            {noformat}
            And at long last, this is the code:
            {code:java|title=Jenkinsfile}
            #!/usr/bin/env groovy

            echo 'Pipeline Script using shared library'

            @Library('******-shared-library@branches/*************') _

            acme.b0 {
              echo 'from Jenkinsfile via "acme.b0"'
            }

            acme.c1 {
              name = 'name from Jenkinsfile via "acme.c1"'
            }

            // This does not work:
            acme.b1 {
              name = 'name from Jenkinsfile via "acme.b1"'
            }
            {code}
            {code:java|title=vars/acme.groovy}
            #!/usr/bin/env groovy

            void b0(Closure body) {
              def b0 = new com.acme.B0()
              b0.build(body)
            }

            void b1(Closure configBody) {
              def b1 = new com.acme.B1(this)
              b1.build(configBody)
            }

            void c1(Closure configBody) {
              def c1 = new com.acme.C1(this)
              c1.build(configBody)
            }
            {code}
            {code:java|title=src/com/acme/B0.groovy}
            #!/usr/bin/env groovy

            package com.acme

            class B0 implements Serializable {

              public void build(Closure body) {
                body()
              }

            }
            {code}
            {code:java|title=src/com/acme/B1.groovy}
            #!/usr/bin/env groovy

            package com.acme

            class B1 extends B0 {

              def script

              B1(def script) {
                this.script = script
              }

              public void build(Closure configBody) {
                // First evaluate the body configuration block, and collect configuration into the object:
                def config = [:]
                configBody.resolveStrategy = Closure.DELEGATE_FIRST
                configBody.delegate = config
                configBody()

                // Then build, based on the configuration provided:
                super.build() { // !!! This is line #21 where the problem occurs
                  script.echo "from B1.build: ${config.name}"
                }
              }

            }
            {code}
            {code:java|title=src/com/acme/C1.groovy}
            #!/usr/bin/env groovy

            package com.acme

            class C1 implements Serializable {

              def script
              def acme

              C1(def script) {
                this.script = script
                this.acme = script.acme
              }

              public void build(Closure configBody) {
                // First evaluate the body configuration block, and collect configuration into the object:
                def config = [:]
                configBody.resolveStrategy = Closure.DELEGATE_FIRST
                configBody.delegate = config
                configBody()

                // Then build, based on the configuration provided:
                acme.b0 {
                  script.echo "from C1.build: ${config.name}"
                }
              }

            }
            {code}

            Please mind: In this case the approach via {{acme.c1}} and {{com.acme.C1}} calling {{acme.b0}} step is the workaround for the problem...
            {quote}

            Based on the minimal pipeline script example of [~pmilliken] in JENKINS-42563 it still fails:
            * Installed pipeline plugin versions:
            {noformat}
            pipeline-model-api: 1.1.9
            pipeline-build-step: 2.5.1
            pipeline-model-definition: 1.1.9
            pipeline-milestone-step: 1.3.1
            pipeline-model-declarative-agent: 1.1.1
            pipeline-stage-step: 2.2
            pipeline-model-extensions: 1.1.9
            script-security: 1.30
            workflow-aggregator: 2.5
            workflow-api: 2.20
            workflow-job: 2.14
            workflow-support: 2.14
            workflow-step-api: 2.12
            workflow-basic-steps: 2.6
            workflow-cps-global-lib: 2.8
            workflow-cps: 2.38
            blueocean: 1.1.5
            blueocean-pipeline-api-impl: 1.1.5
            {noformat}
            * Pipeline code:
            {code:java}
            class A {
              def script2
              A(script) { script2 = script }
              def test(script) {
                script.echo "In A"
              }
              def testWithoutArgs() {
                script2.echo "In A without args"
              }
            }

            class B extends A {
              B(script) { super(script) }
              def test(script) {
                script.echo "In B"
                super.test(script)
              }
              def testWithoutArgs() {
                script2.echo "In B without args"
                super.testWithoutArgs()
              }
            }

            node {

              stage('A without args') {
                new A(this).testWithoutArgs()
              }

              stage('A') {
                new A(this).test(this)
              }

              stage('B without args') {
                new B(this).testWithoutArgs()
              }
              
              stage('B') {
                new B(this).test(this)
              }

            }
            {code}
            * Build log with disabled sandbox option:
            {noformat}
            [Pipeline] node
            Running on master in /var/lib/jenkins/workspace/Sandbox/JENKINS-42563
            [Pipeline] {
            [Pipeline] stage
            [Pipeline] { (A without args)
            [Pipeline] echo
            In A without args
            [Pipeline] }
            [Pipeline] // stage
            [Pipeline] stage
            [Pipeline] { (A)
            [Pipeline] echo
            In A
            [Pipeline] }
            [Pipeline] // stage
            [Pipeline] stage
            [Pipeline] { (B without args)
            [Pipeline] echo
            In B without args
            [Pipeline] }
            [Pipeline] // stage
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] End of Pipeline
            hudson.remoting.ProxyException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
            at sun.reflect.GeneratedConstructorAccessor143.newInstance(Unknown Source)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
            at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
            at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
            at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
            at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:110)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:263)
            at A.testWithoutArgs(WorkflowScript)
            at B.super$2$testWithoutArgs(WorkflowScript)
            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 com.cloudbees.groovy.cps.sandbox.DefaultInvoker.superCall(DefaultInvoker.java:29)
            Caused: hudson.remoting.ProxyException: org.codehaus.groovy.runtime.InvokerInvocationException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
            at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:100)
            at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
            at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
            at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.superCall(DefaultInvoker.java:29)
            at B.testWithoutArgs(WorkflowScript:20)
            at WorkflowScript.run(WorkflowScript:35)
            at ___cps.transform___(Native Method)
            at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:54)
            at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
            at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixName(FunctionCallBlock.java:77)
            at sun.reflect.GeneratedMethodAccessor190.invoke(Unknown Source)
            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.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:173)
            at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:162)
            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:162)
            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:266)
            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: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
            {noformat}
            * Log with enabled sandbox option:
            {noformat}
            [Pipeline] node
            Running on master in /var/lib/jenkins/workspace/Sandbox/JENKINS-42563
            [Pipeline] {
            [Pipeline] stage
            [Pipeline] { (A without args)
            [Pipeline] echo
            In A without args
            [Pipeline] }
            [Pipeline] // stage
            [Pipeline] stage
            [Pipeline] { (A)
            [Pipeline] echo
            In A
            [Pipeline] }
            [Pipeline] // stage
            [Pipeline] stage
            [Pipeline] { (B without args)
            [Pipeline] echo
            In B without args
            [Pipeline] }
            [Pipeline] // stage
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] End of Pipeline
            hudson.remoting.ProxyException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
            at sun.reflect.GeneratedConstructorAccessor143.newInstance(Unknown Source)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
            at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
            at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
            at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
            at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:110)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:263)
            at A.testWithoutArgs(WorkflowScript)
            at B.super$2$testWithoutArgs(WorkflowScript)
            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 org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:207)
            at org.kohsuke.groovy.sandbox.GroovyInterceptor.onSuperCall(GroovyInterceptor.java:49)
            at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onSuperCall(SandboxInterceptor.java:380)
            at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:204)
            at org.kohsuke.groovy.sandbox.impl.Checker.checkedSuperCall(Checker.java:210)
            at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.superCall(SandboxInvoker.java:24)
            Caused: hudson.remoting.ProxyException: org.codehaus.groovy.runtime.InvokerInvocationException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
            at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:100)
            at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
            at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
            at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:207)
            at org.kohsuke.groovy.sandbox.GroovyInterceptor.onSuperCall(GroovyInterceptor.java:49)
            at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onSuperCall(SandboxInterceptor.java:380)
            at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:204)
            at org.kohsuke.groovy.sandbox.impl.Checker.checkedSuperCall(Checker.java:210)
            at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.superCall(SandboxInvoker.java:24)
            at B.testWithoutArgs(WorkflowScript:20)
            at WorkflowScript.run(WorkflowScript:35)
            at ___cps.transform___(Native Method)
            at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:54)
            at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
            at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixName(FunctionCallBlock.java:77)
            at sun.reflect.GeneratedMethodAccessor190.invoke(Unknown Source)
            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.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:173)
            at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:162)
            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:162)
            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:266)
            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: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
            {noformat}
            reinholdfuereder Reinhold Füreder made changes -
            Environment Jenkins 2.49, Pipeline-Groovy Plugin 2.29 and everything related also latest versions Jenkins 2.72, Pipeline-Groovy Plugin 2.38, Pipeline Shared Groovy Libraries Plugin 2.8 and everything related also latest versions
            reinholdfuereder Reinhold Füreder made changes -
            Summary Calling super.method(...) of CPS-transformed code fails with CpsCallableInvocation Calling super.method(...) of CPS-transformed methods fails with CpsCallableInvocation
            reinholdfuereder Reinhold Füreder made changes -
            Summary Calling super.method(...) of CPS-transformed methods fails with CpsCallableInvocation Calling super to CPS-transformed methods fails with CpsCallableInvocation
            reinholdfuereder Reinhold Füreder made changes -
            Description From original issue JENKINS-42563 (please find below a more recent update comment and a smaller reproducer without need of a shared library):
            {quote}
            My goal was to create some abstractions in shared (global pipeline) library so that in the Jenkinsfile I only have the configuration of the build, whereas the re-usable build script logic is fully in the library; so very much like the Section [https://jenkins.io/doc/book/pipeline/shared-libraries/#defining-a-more-structured-dsl.]

            In the shared library I use simple class inheritance, but the call to a super method fails with CpsCallableInvocation.

            This is the stacktrace:
            {noformat}
            hudson.remoting.ProxyException: org.codehaus.groovy.runtime.InvokerInvocationException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
                at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:100)
                at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
                at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1218)
                at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.superCall(DefaultInvoker.java:29)
                at com.acme.B1.build(file:/var/lib/jenkins/jobs/Pipeline-Using-Shared-Library/builds/187/libs/******-shared-library/src/com/acme/B1.groovy:21)
                at acme.b1(/var/lib/jenkins/jobs/Pipeline-Using-Shared-Library/builds/187/libs/******-shared-library/vars/acme.groovy:9)
                at WorkflowScript.run(WorkflowScript:18)
                at ___cps.transform___(Native Method)
                at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:54)
                at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
                at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82)
                at sun.reflect.GeneratedMethodAccessor273.invoke(Unknown Source)
                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:74)
                at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154)
                at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
                at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:33)
                at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:30)
                at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
                at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:30)
                at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:165)
                at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:328)
                at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:80)
                at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:240)
                at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:228)
                at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                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:511)
                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
                at java.lang.Thread.run(Thread.java:745)
            Caused by: hudson.remoting.ProxyException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
                at sun.reflect.GeneratedConstructorAccessor549.newInstance(Unknown Source)
                at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
                at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
                at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
                at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
                at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:263)
                at com.acme.B1.build(B1.groovy)
                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:1218)
                at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.superCall(DefaultInvoker.java:29)
                ... 29 more{noformat}
            This is the build console output, before the aforementioned problem:
            {noformat}
            [Pipeline] echo
            Pipeline Script using shared library
            [Pipeline] echo
            from Jenkinsfile via "acme.b0"
            [Pipeline] echo
            from C1.build: name from Jenkinsfile via "acme.c1"
            [Pipeline] End of Pipeline
            // And then would be the aforementioned stacktrace output
            {noformat}
            And at long last, this is the code:
            {code:java|title=Jenkinsfile}
            #!/usr/bin/env groovy

            echo 'Pipeline Script using shared library'

            @Library('******-shared-library@branches/*************') _

            acme.b0 {
              echo 'from Jenkinsfile via "acme.b0"'
            }

            acme.c1 {
              name = 'name from Jenkinsfile via "acme.c1"'
            }

            // This does not work:
            acme.b1 {
              name = 'name from Jenkinsfile via "acme.b1"'
            }
            {code}
            {code:java|title=vars/acme.groovy}
            #!/usr/bin/env groovy

            void b0(Closure body) {
              def b0 = new com.acme.B0()
              b0.build(body)
            }

            void b1(Closure configBody) {
              def b1 = new com.acme.B1(this)
              b1.build(configBody)
            }

            void c1(Closure configBody) {
              def c1 = new com.acme.C1(this)
              c1.build(configBody)
            }
            {code}
            {code:java|title=src/com/acme/B0.groovy}
            #!/usr/bin/env groovy

            package com.acme

            class B0 implements Serializable {

              public void build(Closure body) {
                body()
              }

            }
            {code}
            {code:java|title=src/com/acme/B1.groovy}
            #!/usr/bin/env groovy

            package com.acme

            class B1 extends B0 {

              def script

              B1(def script) {
                this.script = script
              }

              public void build(Closure configBody) {
                // First evaluate the body configuration block, and collect configuration into the object:
                def config = [:]
                configBody.resolveStrategy = Closure.DELEGATE_FIRST
                configBody.delegate = config
                configBody()

                // Then build, based on the configuration provided:
                super.build() { // !!! This is line #21 where the problem occurs
                  script.echo "from B1.build: ${config.name}"
                }
              }

            }
            {code}
            {code:java|title=src/com/acme/C1.groovy}
            #!/usr/bin/env groovy

            package com.acme

            class C1 implements Serializable {

              def script
              def acme

              C1(def script) {
                this.script = script
                this.acme = script.acme
              }

              public void build(Closure configBody) {
                // First evaluate the body configuration block, and collect configuration into the object:
                def config = [:]
                configBody.resolveStrategy = Closure.DELEGATE_FIRST
                configBody.delegate = config
                configBody()

                // Then build, based on the configuration provided:
                acme.b0 {
                  script.echo "from C1.build: ${config.name}"
                }
              }

            }
            {code}

            Please mind: In this case the approach via {{acme.c1}} and {{com.acme.C1}} calling {{acme.b0}} step is the workaround for the problem...
            {quote}

            Based on the minimal pipeline script example of [~pmilliken] in JENKINS-42563 it still fails:
            * Installed pipeline plugin versions:
            {noformat}
            pipeline-model-api: 1.1.9
            pipeline-build-step: 2.5.1
            pipeline-model-definition: 1.1.9
            pipeline-milestone-step: 1.3.1
            pipeline-model-declarative-agent: 1.1.1
            pipeline-stage-step: 2.2
            pipeline-model-extensions: 1.1.9
            script-security: 1.30
            workflow-aggregator: 2.5
            workflow-api: 2.20
            workflow-job: 2.14
            workflow-support: 2.14
            workflow-step-api: 2.12
            workflow-basic-steps: 2.6
            workflow-cps-global-lib: 2.8
            workflow-cps: 2.38
            blueocean: 1.1.5
            blueocean-pipeline-api-impl: 1.1.5
            {noformat}
            * Pipeline code:
            {code:java}
            class A {
              def script2
              A(script) { script2 = script }
              def test(script) {
                script.echo "In A"
              }
              def testWithoutArgs() {
                script2.echo "In A without args"
              }
            }

            class B extends A {
              B(script) { super(script) }
              def test(script) {
                script.echo "In B"
                super.test(script)
              }
              def testWithoutArgs() {
                script2.echo "In B without args"
                super.testWithoutArgs()
              }
            }

            node {

              stage('A without args') {
                new A(this).testWithoutArgs()
              }

              stage('A') {
                new A(this).test(this)
              }

              stage('B without args') {
                new B(this).testWithoutArgs()
              }
              
              stage('B') {
                new B(this).test(this)
              }

            }
            {code}
            * Build log with disabled sandbox option:
            {noformat}
            [Pipeline] node
            Running on master in /var/lib/jenkins/workspace/Sandbox/JENKINS-42563
            [Pipeline] {
            [Pipeline] stage
            [Pipeline] { (A without args)
            [Pipeline] echo
            In A without args
            [Pipeline] }
            [Pipeline] // stage
            [Pipeline] stage
            [Pipeline] { (A)
            [Pipeline] echo
            In A
            [Pipeline] }
            [Pipeline] // stage
            [Pipeline] stage
            [Pipeline] { (B without args)
            [Pipeline] echo
            In B without args
            [Pipeline] }
            [Pipeline] // stage
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] End of Pipeline
            hudson.remoting.ProxyException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
            at sun.reflect.GeneratedConstructorAccessor143.newInstance(Unknown Source)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
            at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
            at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
            at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
            at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:110)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:263)
            at A.testWithoutArgs(WorkflowScript)
            at B.super$2$testWithoutArgs(WorkflowScript)
            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 com.cloudbees.groovy.cps.sandbox.DefaultInvoker.superCall(DefaultInvoker.java:29)
            Caused: hudson.remoting.ProxyException: org.codehaus.groovy.runtime.InvokerInvocationException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
            at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:100)
            at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
            at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
            at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.superCall(DefaultInvoker.java:29)
            at B.testWithoutArgs(WorkflowScript:20)
            at WorkflowScript.run(WorkflowScript:35)
            at ___cps.transform___(Native Method)
            at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:54)
            at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
            at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixName(FunctionCallBlock.java:77)
            at sun.reflect.GeneratedMethodAccessor190.invoke(Unknown Source)
            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.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:173)
            at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:162)
            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:162)
            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:266)
            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: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
            {noformat}
            * Log with enabled sandbox option:
            {noformat}
            [Pipeline] node
            Running on master in /var/lib/jenkins/workspace/Sandbox/JENKINS-42563
            [Pipeline] {
            [Pipeline] stage
            [Pipeline] { (A without args)
            [Pipeline] echo
            In A without args
            [Pipeline] }
            [Pipeline] // stage
            [Pipeline] stage
            [Pipeline] { (A)
            [Pipeline] echo
            In A
            [Pipeline] }
            [Pipeline] // stage
            [Pipeline] stage
            [Pipeline] { (B without args)
            [Pipeline] echo
            In B without args
            [Pipeline] }
            [Pipeline] // stage
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] End of Pipeline
            hudson.remoting.ProxyException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
            at sun.reflect.GeneratedConstructorAccessor143.newInstance(Unknown Source)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
            at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
            at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
            at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
            at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:110)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:263)
            at A.testWithoutArgs(WorkflowScript)
            at B.super$2$testWithoutArgs(WorkflowScript)
            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 org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:207)
            at org.kohsuke.groovy.sandbox.GroovyInterceptor.onSuperCall(GroovyInterceptor.java:49)
            at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onSuperCall(SandboxInterceptor.java:380)
            at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:204)
            at org.kohsuke.groovy.sandbox.impl.Checker.checkedSuperCall(Checker.java:210)
            at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.superCall(SandboxInvoker.java:24)
            Caused: hudson.remoting.ProxyException: org.codehaus.groovy.runtime.InvokerInvocationException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
            at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:100)
            at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
            at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
            at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:207)
            at org.kohsuke.groovy.sandbox.GroovyInterceptor.onSuperCall(GroovyInterceptor.java:49)
            at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onSuperCall(SandboxInterceptor.java:380)
            at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:204)
            at org.kohsuke.groovy.sandbox.impl.Checker.checkedSuperCall(Checker.java:210)
            at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.superCall(SandboxInvoker.java:24)
            at B.testWithoutArgs(WorkflowScript:20)
            at WorkflowScript.run(WorkflowScript:35)
            at ___cps.transform___(Native Method)
            at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:54)
            at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
            at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixName(FunctionCallBlock.java:77)
            at sun.reflect.GeneratedMethodAccessor190.invoke(Unknown Source)
            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.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:173)
            at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:162)
            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:162)
            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:266)
            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: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
            {noformat}
            From comment for JENKINS-42563:
            {quote}
            Only super calls to native methods were tested IIRC. Support for super calls to CPS-transformed methods is another matter entirely. Probably a subject for a separate bug report.
            {quote}

            From original issue JENKINS-42563 (please find below a more recent update comment and a smaller reproducer without need of a shared library):
            {quote}
            My goal was to create some abstractions in shared (global pipeline) library so that in the Jenkinsfile I only have the configuration of the build, whereas the re-usable build script logic is fully in the library; so very much like the Section [https://jenkins.io/doc/book/pipeline/shared-libraries/#defining-a-more-structured-dsl.]

            In the shared library I use simple class inheritance, but the call to a super method fails with CpsCallableInvocation.

            This is the stacktrace:
            {noformat}
            hudson.remoting.ProxyException: org.codehaus.groovy.runtime.InvokerInvocationException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
                at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:100)
                at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
                at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1218)
                at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.superCall(DefaultInvoker.java:29)
                at com.acme.B1.build(file:/var/lib/jenkins/jobs/Pipeline-Using-Shared-Library/builds/187/libs/******-shared-library/src/com/acme/B1.groovy:21)
                at acme.b1(/var/lib/jenkins/jobs/Pipeline-Using-Shared-Library/builds/187/libs/******-shared-library/vars/acme.groovy:9)
                at WorkflowScript.run(WorkflowScript:18)
                at ___cps.transform___(Native Method)
                at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:54)
                at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
                at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82)
                at sun.reflect.GeneratedMethodAccessor273.invoke(Unknown Source)
                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:74)
                at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154)
                at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
                at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:33)
                at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:30)
                at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
                at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:30)
                at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:165)
                at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:328)
                at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:80)
                at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:240)
                at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:228)
                at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                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:511)
                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
                at java.lang.Thread.run(Thread.java:745)
            Caused by: hudson.remoting.ProxyException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
                at sun.reflect.GeneratedConstructorAccessor549.newInstance(Unknown Source)
                at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
                at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
                at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
                at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
                at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:263)
                at com.acme.B1.build(B1.groovy)
                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:1218)
                at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.superCall(DefaultInvoker.java:29)
                ... 29 more{noformat}
            This is the build console output, before the aforementioned problem:
            {noformat}
            [Pipeline] echo
            Pipeline Script using shared library
            [Pipeline] echo
            from Jenkinsfile via "acme.b0"
            [Pipeline] echo
            from C1.build: name from Jenkinsfile via "acme.c1"
            [Pipeline] End of Pipeline
            // And then would be the aforementioned stacktrace output
            {noformat}
            And at long last, this is the code:
            {code:java|title=Jenkinsfile}
            #!/usr/bin/env groovy

            echo 'Pipeline Script using shared library'

            @Library('******-shared-library@branches/*************') _

            acme.b0 {
              echo 'from Jenkinsfile via "acme.b0"'
            }

            acme.c1 {
              name = 'name from Jenkinsfile via "acme.c1"'
            }

            // This does not work:
            acme.b1 {
              name = 'name from Jenkinsfile via "acme.b1"'
            }
            {code}
            {code:java|title=vars/acme.groovy}
            #!/usr/bin/env groovy

            void b0(Closure body) {
              def b0 = new com.acme.B0()
              b0.build(body)
            }

            void b1(Closure configBody) {
              def b1 = new com.acme.B1(this)
              b1.build(configBody)
            }

            void c1(Closure configBody) {
              def c1 = new com.acme.C1(this)
              c1.build(configBody)
            }
            {code}
            {code:java|title=src/com/acme/B0.groovy}
            #!/usr/bin/env groovy

            package com.acme

            class B0 implements Serializable {

              public void build(Closure body) {
                body()
              }

            }
            {code}
            {code:java|title=src/com/acme/B1.groovy}
            #!/usr/bin/env groovy

            package com.acme

            class B1 extends B0 {

              def script

              B1(def script) {
                this.script = script
              }

              public void build(Closure configBody) {
                // First evaluate the body configuration block, and collect configuration into the object:
                def config = [:]
                configBody.resolveStrategy = Closure.DELEGATE_FIRST
                configBody.delegate = config
                configBody()

                // Then build, based on the configuration provided:
                super.build() { // !!! This is line #21 where the problem occurs
                  script.echo "from B1.build: ${config.name}"
                }
              }

            }
            {code}
            {code:java|title=src/com/acme/C1.groovy}
            #!/usr/bin/env groovy

            package com.acme

            class C1 implements Serializable {

              def script
              def acme

              C1(def script) {
                this.script = script
                this.acme = script.acme
              }

              public void build(Closure configBody) {
                // First evaluate the body configuration block, and collect configuration into the object:
                def config = [:]
                configBody.resolveStrategy = Closure.DELEGATE_FIRST
                configBody.delegate = config
                configBody()

                // Then build, based on the configuration provided:
                acme.b0 {
                  script.echo "from C1.build: ${config.name}"
                }
              }

            }
            {code}

            Please mind: In this case the approach via {{acme.c1}} and {{com.acme.C1}} calling {{acme.b0}} step is the workaround for the problem...
            {quote}

            Based on the minimal pipeline script example of [~pmilliken] in JENKINS-42563 it still fails:
            * Installed pipeline plugin versions:
            {noformat}
            pipeline-model-api: 1.1.9
            pipeline-build-step: 2.5.1
            pipeline-model-definition: 1.1.9
            pipeline-milestone-step: 1.3.1
            pipeline-model-declarative-agent: 1.1.1
            pipeline-stage-step: 2.2
            pipeline-model-extensions: 1.1.9
            script-security: 1.30
            workflow-aggregator: 2.5
            workflow-api: 2.20
            workflow-job: 2.14
            workflow-support: 2.14
            workflow-step-api: 2.12
            workflow-basic-steps: 2.6
            workflow-cps-global-lib: 2.8
            workflow-cps: 2.38
            blueocean: 1.1.5
            blueocean-pipeline-api-impl: 1.1.5
            {noformat}
            * Pipeline code:
            {code:java}
            class A {
              def script2
              A(script) { script2 = script }
              def test(script) {
                script.echo "In A"
              }
              def testWithoutArgs() {
                script2.echo "In A without args"
              }
            }

            class B extends A {
              B(script) { super(script) }
              def test(script) {
                script.echo "In B"
                super.test(script)
              }
              def testWithoutArgs() {
                script2.echo "In B without args"
                super.testWithoutArgs()
              }
            }

            node {

              stage('A without args') {
                new A(this).testWithoutArgs()
              }

              stage('A') {
                new A(this).test(this)
              }

              stage('B without args') {
                new B(this).testWithoutArgs()
              }
              
              stage('B') {
                new B(this).test(this)
              }

            }
            {code}
            * Build log with disabled sandbox option:
            {noformat}
            [Pipeline] node
            Running on master in /var/lib/jenkins/workspace/Sandbox/JENKINS-42563
            [Pipeline] {
            [Pipeline] stage
            [Pipeline] { (A without args)
            [Pipeline] echo
            In A without args
            [Pipeline] }
            [Pipeline] // stage
            [Pipeline] stage
            [Pipeline] { (A)
            [Pipeline] echo
            In A
            [Pipeline] }
            [Pipeline] // stage
            [Pipeline] stage
            [Pipeline] { (B without args)
            [Pipeline] echo
            In B without args
            [Pipeline] }
            [Pipeline] // stage
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] End of Pipeline
            hudson.remoting.ProxyException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
            at sun.reflect.GeneratedConstructorAccessor143.newInstance(Unknown Source)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
            at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
            at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
            at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
            at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:110)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:263)
            at A.testWithoutArgs(WorkflowScript)
            at B.super$2$testWithoutArgs(WorkflowScript)
            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 com.cloudbees.groovy.cps.sandbox.DefaultInvoker.superCall(DefaultInvoker.java:29)
            Caused: hudson.remoting.ProxyException: org.codehaus.groovy.runtime.InvokerInvocationException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
            at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:100)
            at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
            at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
            at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.superCall(DefaultInvoker.java:29)
            at B.testWithoutArgs(WorkflowScript:20)
            at WorkflowScript.run(WorkflowScript:35)
            at ___cps.transform___(Native Method)
            at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:54)
            at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
            at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixName(FunctionCallBlock.java:77)
            at sun.reflect.GeneratedMethodAccessor190.invoke(Unknown Source)
            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.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:173)
            at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:162)
            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:162)
            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:266)
            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: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
            {noformat}
            * Log with enabled sandbox option:
            {noformat}
            [Pipeline] node
            Running on master in /var/lib/jenkins/workspace/Sandbox/JENKINS-42563
            [Pipeline] {
            [Pipeline] stage
            [Pipeline] { (A without args)
            [Pipeline] echo
            In A without args
            [Pipeline] }
            [Pipeline] // stage
            [Pipeline] stage
            [Pipeline] { (A)
            [Pipeline] echo
            In A
            [Pipeline] }
            [Pipeline] // stage
            [Pipeline] stage
            [Pipeline] { (B without args)
            [Pipeline] echo
            In B without args
            [Pipeline] }
            [Pipeline] // stage
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] End of Pipeline
            hudson.remoting.ProxyException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
            at sun.reflect.GeneratedConstructorAccessor143.newInstance(Unknown Source)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
            at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
            at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
            at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
            at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:110)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:263)
            at A.testWithoutArgs(WorkflowScript)
            at B.super$2$testWithoutArgs(WorkflowScript)
            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 org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:207)
            at org.kohsuke.groovy.sandbox.GroovyInterceptor.onSuperCall(GroovyInterceptor.java:49)
            at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onSuperCall(SandboxInterceptor.java:380)
            at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:204)
            at org.kohsuke.groovy.sandbox.impl.Checker.checkedSuperCall(Checker.java:210)
            at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.superCall(SandboxInvoker.java:24)
            Caused: hudson.remoting.ProxyException: org.codehaus.groovy.runtime.InvokerInvocationException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
            at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:100)
            at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
            at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
            at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:207)
            at org.kohsuke.groovy.sandbox.GroovyInterceptor.onSuperCall(GroovyInterceptor.java:49)
            at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onSuperCall(SandboxInterceptor.java:380)
            at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:204)
            at org.kohsuke.groovy.sandbox.impl.Checker.checkedSuperCall(Checker.java:210)
            at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.superCall(SandboxInvoker.java:24)
            at B.testWithoutArgs(WorkflowScript:20)
            at WorkflowScript.run(WorkflowScript:35)
            at ___cps.transform___(Native Method)
            at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:54)
            at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
            at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixName(FunctionCallBlock.java:77)
            at sun.reflect.GeneratedMethodAccessor190.invoke(Unknown Source)
            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.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:173)
            at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:162)
            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:162)
            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:266)
            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: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
            {noformat}
            jglick Jesse Glick made changes -
            Assignee Jesse Glick [ jglick ]
            abayer Andrew Bayer added a comment -

            Will look into this next week.

            abayer Andrew Bayer added a comment - Will look into this next week.
            abayer Andrew Bayer made changes -
            Assignee Andrew Bayer [ abayer ]
            abayer Andrew Bayer added a comment -

            So...yeah. Ow. I need to better understand how this works when calling super.method() with a non-CPS transformed superclass, because as best as I can tell, MetaClass.invokeMethod in this case is doing something different for a transformed superclass than a non-transformed one, and I can't quite figure out why yet.

            abayer Andrew Bayer added a comment - So...yeah. Ow. I need to better understand how this works when calling super.method() with a non-CPS transformed superclass, because as best as I can tell, MetaClass.invokeMethod in this case is doing something different for a transformed superclass than a non-transformed one, and I can't quite figure out why yet.
            abayer Andrew Bayer made changes -
            Link This issue relates to JENKINS-45904 [ JENKINS-45904 ]
            abayer Andrew Bayer added a comment -

            I've got a test reproducing this in https://github.com/cloudbees/groovy-cps/pull/65 - no fix yet, but wanted to get the PR up with the reproduction in case someone else picks this up before I get it figured out.

            abayer Andrew Bayer added a comment - I've got a test reproducing this in https://github.com/cloudbees/groovy-cps/pull/65 - no fix yet, but wanted to get the PR up with the reproduction in case someone else picks this up before I get it figured out.
            abayer Andrew Bayer made changes -
            Remote Link This issue links to "groovy-cps PR #65 (Web Link)" [ 17424 ]
            abayer Andrew Bayer made changes -
            Labels CpsCallableInvocation-related
            jglick Jesse Glick added a comment -

            Be sure to check also in non-sandboxed mode.

            jglick Jesse Glick added a comment - Be sure to check also in non-sandboxed mode.
            abayer Andrew Bayer added a comment - - edited

            Ah, yeah, will do.

            EDIT: Or rather, I'm assuming you meant sandboxed-mode, since we were already checking in non-sandboxed mode. =)

            abayer Andrew Bayer added a comment - - edited Ah, yeah, will do. EDIT: Or rather, I'm assuming you meant sandboxed-mode, since we were already checking in non-sandboxed mode. =)
            bvale Bernardo Vale added a comment -

            Do you guys have updates regarding this issue?

             

            I'm trying to do the same thing and ran into this problem =/

            bvale Bernardo Vale added a comment - Do you guys have updates regarding this issue?   I'm trying to do the same thing and ran into this problem =/
            ifernandezcalvo Ivan Fernandez Calvo made changes -
            Comment [ It happens also with any parent class method that you call from constructor, I test it with  simple shared library with two classes

            Class A
            {code:java}
            package org.foo;

            public class A implements Serializable {
             public A() {}
             public void funcA(script) {
              script.echo "A"
             }
            }
            {code}
            Class B that extends from A and call the method funcA in the constructor.
            {code:java}
            package org.foo;

            public class B extends A implements Serializable {
             public B(script) {
              super()
              script.echo("C")
              funcA("D")
             }
             public void funcB(script){
              script.echo "B"
              funcA(script)
             }
            }
            {code}
             
             Pipeline code
            {code:java}
            @Library('testlib')
            import org.foo.B

            node(){
             stage('use B') {
              def b = new B(this)
              b.funcA(this)
              b.funcB(this)
             }
            }
            {code}
             

            Exception

             
            {code:java}
            [Pipeline] node
            Running on master in /Users/inifc/cloudbees/support/cases/54424/jenkins-home/workspace/test
            [Pipeline] {
            [Pipeline] stage
            [Pipeline] { (use B)
            [Pipeline] echo
            C
            [Pipeline] }
            [Pipeline] // stage
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] End of Pipeline
            com.cloudbees.groovy.cps.impl.CpsCallableInvocation
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
            at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
            at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
            at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:263)
            at org.foo.A.funcA(A.groovy)
            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:497)
            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.callCurrent(PogoMetaClassSite.java:69)
            at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
            at org.foo.B.<init>(B.groovy:7)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
            at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
            at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
            at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
            at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.constructorCall(DefaultInvoker.java:24)
            at WorkflowScript.run(WorkflowScript:6)
            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.GeneratedMethodAccessor185.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:497)
            at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
            at com.cloudbees.groovy.cps.impl.LocalVariableBlock$LocalVariable.get(LocalVariableBlock.java:39)
            at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
            at com.cloudbees.groovy.cps.impl.LocalVariableBlock.evalLValue(LocalVariableBlock.java:28)
            at com.cloudbees.groovy.cps.LValueBlock$BlockImpl.eval(LValueBlock.java:55)
            at com.cloudbees.groovy.cps.LValueBlock.eval(LValueBlock.java:16)
            at com.cloudbees.groovy.cps.Next.step(Next.java:83)
            at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:173)
            at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:162)
            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:162)
            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:266)
            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:511)
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
            at java.lang.Thread.run(Thread.java:745)
            Finished: FAILURE
            {code}
              ]

            Seems like you can not call methods from other classes from the constructor, this example also fails.

            public class ClassForNothing{ 
             public void doNothing(){} 
            } 
            
            public class MyClass implements Serializable{ 
             public MyClass(){ 
              def t = new ClassForNothing() 
              t.doNothing() 
             } 
            } 
            
            def test = new MyClass()
            ifernandezcalvo Ivan Fernandez Calvo added a comment - Seems like you can not call methods from other classes from the constructor, this example also fails. public class ClassForNothing{ public void doNothing(){} } public class MyClass implements Serializable{ public MyClass(){ def t = new ClassForNothing() t.doNothing() } } def test = new MyClass()
            jglick Jesse Glick added a comment -

            Correct, that is illegal, unless doNothing is marked @NonCPS. As designed.

            jglick Jesse Glick added a comment - Correct, that is illegal, unless doNothing is marked @NonCPS . As designed.
            abayer Andrew Bayer made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            abayer Andrew Bayer made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            abayer Andrew Bayer added a comment -

            Hoorah, figured it out. PR updated accordingly.

            abayer Andrew Bayer added a comment - Hoorah, figured it out. PR updated accordingly.
            abayer Andrew Bayer made changes -
            Sprint Pipeline - March 2018 [ 506 ]
            erez_arbell Erez Arbell added a comment - - edited

            I do not understand from the above comment what is the status of this issue. Can you explain?

            I am also facing the same issue. Here is a simple example:

            class A {
              def speak(script) {
                script.echo "Hello from A"
              }
            }
            
            class B extends A {
              def speak(script) {
                script.echo "Hello from B"
                super.speak(script)
              }
            }
            
            node('master') {
              def b = new B()
              b.speak(this)
            }
            

            Output:

            [Pipeline] {
            [Pipeline] echo
            Hello from B
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] End of Pipeline
            hudson.remoting.ProxyException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
            Caused: hudson.remoting.ProxyException: org.codehaus.groovy.runtime.InvokerInvocationException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation
            	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:100)
            	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
            	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
            	at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:214)
            	at org.kohsuke.groovy.sandbox.GroovyInterceptor.onSuperCall(GroovyInterceptor.java:49)
            	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onSuperCall(SandboxInterceptor.java:390)
            	at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:211)
            	at org.kohsuke.groovy.sandbox.impl.Checker.checkedSuperCall(Checker.java:217)
            	at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.superCall(SandboxInvoker.java:25)
            	at B.speak(WorkflowScript:10)
            	at WorkflowScript.run(WorkflowScript:16)
            	at ___cps.transform___(Native Method)
            	at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:54)
            	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
            	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82)
            	at sun.reflect.GeneratedMethodAccessor71.invoke(Unknown Source)
            	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.LocalVariableBlock$LocalVariable.get(LocalVariableBlock.java:39)
            	at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
            	at com.cloudbees.groovy.cps.impl.LocalVariableBlock.evalLValue(LocalVariableBlock.java:28)
            	at com.cloudbees.groovy.cps.LValueBlock$BlockImpl.eval(LValueBlock.java:55)
            	at com.cloudbees.groovy.cps.LValueBlock.eval(LValueBlock.java:16)
            	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:331)
            	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:82)
            	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:243)
            	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:231)
            	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
            	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            	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: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
            

            A workaround is:

            class B extends A {
              @NonCPS
              def speak(script) {
            ...

            then output is 

            [Pipeline] {
            [Pipeline] echo
            Hello from B
            [Pipeline] echo
            Hello from A
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] End of Pipeline
            Finished: SUCCESS
            

            but this is not ideal solution because then I can't call other CPS methods from this nonCPS method.

            erez_arbell Erez Arbell added a comment - - edited I do not understand from the above comment what is the status of this issue. Can you explain? I am also facing the same issue. Here is a simple example: class A { def speak(script) { script.echo "Hello from A" } } class B extends A { def speak(script) { script.echo "Hello from B" super .speak(script) } } node( 'master' ) { def b = new B() b.speak( this ) } Output: [Pipeline] { [Pipeline] echo Hello from B [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline hudson.remoting.ProxyException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation Caused: hudson.remoting.ProxyException: org.codehaus.groovy.runtime.InvokerInvocationException: com.cloudbees.groovy.cps.impl.CpsCallableInvocation at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:100) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213) at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:214) at org.kohsuke.groovy.sandbox.GroovyInterceptor.onSuperCall(GroovyInterceptor.java:49) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onSuperCall(SandboxInterceptor.java:390) at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:211) at org.kohsuke.groovy.sandbox.impl.Checker.checkedSuperCall(Checker.java:217) at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.superCall(SandboxInvoker.java:25) at B.speak(WorkflowScript:10) at WorkflowScript.run(WorkflowScript:16) at ___cps.transform___(Native Method) at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:54) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82) at sun.reflect.GeneratedMethodAccessor71.invoke(Unknown Source) 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.LocalVariableBlock$LocalVariable.get(LocalVariableBlock.java:39) at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30) at com.cloudbees.groovy.cps.impl.LocalVariableBlock.evalLValue(LocalVariableBlock.java:28) at com.cloudbees.groovy.cps.LValueBlock$BlockImpl.eval(LValueBlock.java:55) at com.cloudbees.groovy.cps.LValueBlock.eval(LValueBlock.java:16) 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:331) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:82) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:243) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:231) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64) at java.util.concurrent.FutureTask.run(FutureTask.java:266) 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: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 A workaround is: class B extends A { @NonCPS def speak(script) { ... then output is  [Pipeline] { [Pipeline] echo Hello from B [Pipeline] echo Hello from A [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline Finished: SUCCESS but this is not ideal solution because then I can't call other CPS methods from this nonCPS method.
            abayer Andrew Bayer added a comment -

            This has been merged and will probably be in the next workflow-cps release, 2.46.

            abayer Andrew Bayer added a comment - This has been merged and will probably be in the next workflow-cps release, 2.46.
            abayer Andrew Bayer made changes -
            Resolution Fixed [ 1 ]
            Status In Review [ 10005 ] Resolved [ 5 ]

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            pom.xml
            http://jenkins-ci.org/commit/script-security-plugin/5b4ff55c2bae0de436e4bc9b5960eb7a4455ad0f
            Log:
            Merge pull request #190 from abayer/groovy-sandbox-1.17

            JENKINS-45982 Switch to groovy-sandbox 1.17 release.

            Compare: https://github.com/jenkinsci/script-security-plugin/compare/8e4eac03fd71...5b4ff55c2bae

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: pom.xml http://jenkins-ci.org/commit/script-security-plugin/5b4ff55c2bae0de436e4bc9b5960eb7a4455ad0f Log: Merge pull request #190 from abayer/groovy-sandbox-1.17 JENKINS-45982 Switch to groovy-sandbox 1.17 release. Compare: https://github.com/jenkinsci/script-security-plugin/compare/8e4eac03fd71...5b4ff55c2bae
            abayer Andrew Bayer made changes -
            Remote Link This issue links to "workflow-cps PR #212 (Web Link)" [ 20254 ]

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            pom.xml
            src/test/java/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition2Test.java
            http://jenkins-ci.org/commit/workflow-cps-plugin/672122274d4eab2217ae4d5460c984f953905d63
            Log:
            JENKINS-45982 Fix calling CPS-transformed super methods.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: pom.xml src/test/java/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition2Test.java http://jenkins-ci.org/commit/workflow-cps-plugin/672122274d4eab2217ae4d5460c984f953905d63 Log: JENKINS-45982 Fix calling CPS-transformed super methods.

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            pom.xml
            src/test/java/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition2Test.java
            http://jenkins-ci.org/commit/workflow-cps-plugin/7ac0d46ce3ef04525a74570962328a12adea9add
            Log:
            Merge pull request #212 from abayer/jenkins-45982

            JENKINS-45982 Fix calling CPS-transformed super methods.

            Compare: https://github.com/jenkinsci/workflow-cps-plugin/compare/a63e6848d642...7ac0d46ce3ef

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: pom.xml src/test/java/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition2Test.java http://jenkins-ci.org/commit/workflow-cps-plugin/7ac0d46ce3ef04525a74570962328a12adea9add Log: Merge pull request #212 from abayer/jenkins-45982 JENKINS-45982 Fix calling CPS-transformed super methods. Compare: https://github.com/jenkinsci/workflow-cps-plugin/compare/a63e6848d642...7ac0d46ce3ef
            pyrocks Mor L added a comment -

            Hi,

            when is workflow-cps  2.46 going to be released?

            As it stands all my inheritance trials in Shared Libraries ended in failures due to this and similar errors.

            Thanks.

            pyrocks Mor L added a comment - Hi, when is workflow-cps   2.46 going to be released? As it stands all my inheritance trials in Shared Libraries ended in failures due to this and similar errors. Thanks.

            People

              abayer Andrew Bayer
              reinholdfuereder Reinhold Füreder
              Votes:
              9 Vote for this issue
              Watchers:
              24 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: