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.

  • Executing the following: {code:title=Jenkinsfile} checkout([$class: 'GitSCM', branches: [[name: "origin/test"], [name: "origin/master"]], doGenerateSubmoduleConfigurations: false, submoduleCfg: [], userRemoteConfigs: [[url: 'some url', credentialsId: 'some creds']], extensions: [ [$class: 'PruneStaleBranch'], [$class: 'CleanBeforeCheckout'], [$class: 'BuildChooserSetting', buildChooser: [$class: 'AlternativeBuildChooser']] ] ]) {code} Throwing the following exception: {code} java.lang.ClassCastException: org.jenkinsci.plugins.workflow.job.WorkflowRun cannot be cast to hudson.model.AbstractBuild at org.jenkinsci.plugins.git.chooser.alternative.AlternativeBuildChooser$1.invoke(AlternativeBuildChooser.java:44) at hudson.plugins.git.GitSCM$BuildChooserContextImpl.actOnBuild(GitSCM.java:907) at org.jenkinsci.plugins.git.chooser.alternative.AlternativeBuildChooser.getCandidateRevisions(AlternativeBuildChooser.java:44) at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:995) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1098) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:109) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:83) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:73) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:49) at hudson.security.ACL.impersonate(ACL.java:213) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:47) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) {code}
    via by Sebastian Godelet,
    • java.lang.ClassCastException: org.jenkinsci.plugins.workflow.job.WorkflowRun cannot be cast to hudson.model.AbstractBuild at org.jenkinsci.plugins.git.chooser.alternative.AlternativeBuildChooser$1.invoke(AlternativeBuildChooser.java:44) at hudson.plugins.git.GitSCM$BuildChooserContextImpl.actOnBuild(GitSCM.java:907) at org.jenkinsci.plugins.git.chooser.alternative.AlternativeBuildChooser.getCandidateRevisions(AlternativeBuildChooser.java:44) at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:995) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1098) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:109) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:83) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:73) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:49) at hudson.security.ACL.impersonate(ACL.java:213) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:47) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)
    No Bugmate found.