java.lang.ClassCastException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • I'm trying to use the example project at https://github.com/sheehan/job-dsl-gradle-example to create jobs. 1. I created a new job that uses this repo as the SCM. 2. Add an Invoke Gradle build step, use gradle wrapper, invoking clean test workspace 3. Add a 'process job dsl' build step, using 'build/workspace/**/*.groovy' as the scripts Result: [Gradle] - Launching build. [workspace] $ /home/marc/.jenkins/jobs/job-dsl-example-thingie/workspace/gradlew clean test workspace :clean :compileJava UP-TO-DATE :compileGroovy :processResources UP-TO-DATE :classes :compileTestJava UP-TO-DATE :compileTestGroovy :processTestResources UP-TO-DATE :testClasses :test :workspace BUILD SUCCESSFUL Total time: 7.989 secs Build step 'Invoke Gradle script' changed build result to SUCCESS FATAL: org.codehaus.groovy.runtime.InvokerHelper$2 cannot be cast to javaposse.jobdsl.dsl.JobParent java.lang.ClassCastException: org.codehaus.groovy.runtime.InvokerHelper$2 cannot be cast to javaposse.jobdsl.dsl.JobParent at javaposse.jobdsl.dsl.DslScriptLoader.runDslEngineForParent(DslScriptLoader.java:64) at javaposse.jobdsl.dsl.DslScriptLoader.runDslEngine(DslScriptLoader.java:89) at javaposse.jobdsl.plugin.ExecuteDslScripts.perform(ExecuteDslScripts.java:177) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770) at hudson.model.Build$BuildExecution.build(Build.java:199) at hudson.model.Build$BuildExecution.doRun(Build.java:160) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:533) at hudson.model.Run.execute(Run.java:1759) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240)
    via by Marc Esher,
  • I'm trying to use the example project at https://github.com/sheehan/job-dsl-gradle-example to create jobs. 1. I created a new job that uses this repo as the SCM. 2. Add an Invoke Gradle build step, use gradle wrapper, invoking clean test workspace 3. Add a 'process job dsl' build step, using 'build/workspace/**/*.groovy' as the scripts Result: [Gradle] - Launching build. [workspace] $ /home/marc/.jenkins/jobs/job-dsl-example-thingie/workspace/gradlew clean test workspace :clean :compileJava UP-TO-DATE :compileGroovy :processResources UP-TO-DATE :classes :compileTestJava UP-TO-DATE :compileTestGroovy :processTestResources UP-TO-DATE :testClasses :test :workspace BUILD SUCCESSFUL Total time: 7.989 secs Build step 'Invoke Gradle script' changed build result to SUCCESS FATAL: org.codehaus.groovy.runtime.InvokerHelper$2 cannot be cast to javaposse.jobdsl.dsl.JobParent java.lang.ClassCastException: org.codehaus.groovy.runtime.InvokerHelper$2 cannot be cast to javaposse.jobdsl.dsl.JobParent at javaposse.jobdsl.dsl.DslScriptLoader.runDslEngineForParent(DslScriptLoader.java:64) at javaposse.jobdsl.dsl.DslScriptLoader.runDslEngine(DslScriptLoader.java:89) at javaposse.jobdsl.plugin.ExecuteDslScripts.perform(ExecuteDslScripts.java:177) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770) at hudson.model.Build$BuildExecution.build(Build.java:199) at hudson.model.Build$BuildExecution.doRun(Build.java:160) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:533) at hudson.model.Run.execute(Run.java:1759) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240)
    via by Marc Esher,
    • java.lang.ClassCastException: org.codehaus.groovy.runtime.InvokerHelper$2 cannot be cast to javaposse.jobdsl.dsl.JobParent at javaposse.jobdsl.dsl.DslScriptLoader.runDslEngineForParent(DslScriptLoader.java:64) at javaposse.jobdsl.dsl.DslScriptLoader.runDslEngine(DslScriptLoader.java:89) at javaposse.jobdsl.plugin.ExecuteDslScripts.perform(ExecuteDslScripts.java:177) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770) at hudson.model.Build$BuildExecution.build(Build.java:199) at hudson.model.Build$BuildExecution.doRun(Build.java:160) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:533) at hudson.model.Run.execute(Run.java:1759) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240)
    No Bugmate found.