java.lang.ClassCastException: org.jenkinsci.plugins.workflow.job.WorkflowJob cannot be cast to hudson.model.AbstractProject

Jenkins JIRA | Tony Finn | 2 years ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    Created a job to launch a Jenkins workflow plugin with parameters. The parameters are as follows: module=aop-table branch=master DEBUG=false The resulting output is: Started by user Finn, Tony [EnvInject] - Loading node environment variables. Building on master in workspace /var/lib/jenkins/workspace/Template for AOPUI Components Pipeline ERROR: Build step failed with exception java.lang.ClassCastException: org.jenkinsci.plugins.workflow.job.WorkflowJob cannot be cast to hudson.model.AbstractProject at hudson.plugins.parameterizedtrigger.TriggerBuilder.getProjectListAsString(TriggerBuilder.java:163) at hudson.plugins.parameterizedtrigger.TriggerBuilder.perform(TriggerBuilder.java:121) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779) at hudson.model.Build$BuildExecution.build(Build.java:205) at hudson.model.Build$BuildExecution.doRun(Build.java:162) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537) at hudson.model.Run.execute(Run.java:1741) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:381) Build step 'Trigger/call builds on other projects' marked build as failure Finished: FAILURE However, the child job is actually launched and succeeds.

    Jenkins JIRA | 2 years ago | Tony Finn
    java.lang.ClassCastException: org.jenkinsci.plugins.workflow.job.WorkflowJob cannot be cast to hudson.model.AbstractProject
  2. 0

    Created a job to launch a Jenkins workflow plugin with parameters. The parameters are as follows: module=aop-table branch=master DEBUG=false The resulting output is: Started by user Finn, Tony [EnvInject] - Loading node environment variables. Building on master in workspace /var/lib/jenkins/workspace/Template for AOPUI Components Pipeline ERROR: Build step failed with exception java.lang.ClassCastException: org.jenkinsci.plugins.workflow.job.WorkflowJob cannot be cast to hudson.model.AbstractProject at hudson.plugins.parameterizedtrigger.TriggerBuilder.getProjectListAsString(TriggerBuilder.java:163) at hudson.plugins.parameterizedtrigger.TriggerBuilder.perform(TriggerBuilder.java:121) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779) at hudson.model.Build$BuildExecution.build(Build.java:205) at hudson.model.Build$BuildExecution.doRun(Build.java:162) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537) at hudson.model.Run.execute(Run.java:1741) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:381) Build step 'Trigger/call builds on other projects' marked build as failure Finished: FAILURE However, the child job is actually launched and succeeds.

    Jenkins JIRA | 2 years ago | Tony Finn
    java.lang.ClassCastException: org.jenkinsci.plugins.workflow.job.WorkflowJob cannot be cast to hudson.model.AbstractProject

    Root Cause Analysis

    1. java.lang.ClassCastException

      org.jenkinsci.plugins.workflow.job.WorkflowJob cannot be cast to hudson.model.AbstractProject

      at hudson.plugins.parameterizedtrigger.TriggerBuilder.getProjectListAsString()
    2. Hudson Parameterized Trigger plugin
      TriggerBuilder.perform
      1. hudson.plugins.parameterizedtrigger.TriggerBuilder.getProjectListAsString(TriggerBuilder.java:163)
      2. hudson.plugins.parameterizedtrigger.TriggerBuilder.perform(TriggerBuilder.java:121)
      2 frames
    3. Hudson
      Executor.run
      1. hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      2. hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
      3. hudson.model.Build$BuildExecution.build(Build.java:205)
      4. hudson.model.Build$BuildExecution.doRun(Build.java:162)
      5. hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537)
      6. hudson.model.Run.execute(Run.java:1741)
      7. hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      8. hudson.model.ResourceController.execute(ResourceController.java:98)
      9. hudson.model.Executor.run(Executor.java:381)
      9 frames