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.

  • When an item which doesn't have an AbstractProject task stay on the queue blocks the build queue. This happens specifically with CloudBees proprietary plugin long-running-builds. However, it is in my opinion a bug. It might be perfect not to use Abstractproject and better use Job instead so Workflow plugin is integrated. I might work on this, but for the moment my intention is just to fix this bug more than integrate with Workflow. {code:java} 2015-08-08 13:50:48.211+0200 [id=62] SEVERE hudson.triggers.SafeTimerTask#run: Timer task hudson.model.Queue$MaintainTask@423e2af8 failed java.lang.ClassCastException: com.cloudbees.jenkins.plugins.longrunning.BackgroundTask cannot be cast to hudson.model.AbstractProject at hudson.plugins.buildblocker.BuildBlockerQueueTaskDispatcher.getBuildBlockerProperty(BuildBlockerQueueTaskDispatcher.java:199) at hudson.plugins.buildblocker.BuildBlockerQueueTaskDispatcher.canTake(BuildBlockerQueueTaskDispatcher.java:108) at hudson.model.Queue$JobOffer.canTake(Queue.java:281) at hudson.model.Queue.maintain(Queue.java:1049) at hudson.model.Queue$MaintainTask.doRun(Queue.java:2033) at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:54) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) {code}
    via by Félix Belzunce Arcos,
  • When an item which doesn't have an AbstractProject task stay on the queue blocks the build queue. This happens specifically with CloudBees proprietary plugin long-running-builds. However, it is in my opinion a bug. It might be perfect not to use Abstractproject and better use Job instead so Workflow plugin is integrated. I might work on this, but for the moment my intention is just to fix this bug more than integrate with Workflow. {code:java} 2015-08-08 13:50:48.211+0200 [id=62] SEVERE hudson.triggers.SafeTimerTask#run: Timer task hudson.model.Queue$MaintainTask@423e2af8 failed java.lang.ClassCastException: com.cloudbees.jenkins.plugins.longrunning.BackgroundTask cannot be cast to hudson.model.AbstractProject at hudson.plugins.buildblocker.BuildBlockerQueueTaskDispatcher.getBuildBlockerProperty(BuildBlockerQueueTaskDispatcher.java:199) at hudson.plugins.buildblocker.BuildBlockerQueueTaskDispatcher.canTake(BuildBlockerQueueTaskDispatcher.java:108) at hudson.model.Queue$JobOffer.canTake(Queue.java:281) at hudson.model.Queue.maintain(Queue.java:1049) at hudson.model.Queue$MaintainTask.doRun(Queue.java:2033) at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:54) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) {code}
    via by Félix Belzunce Arcos,
  • The error message shown in jenkins log is: {code:java} Aug 21, 2015 1:23:23 PM SCHWERWIEGEND hudson.triggers.SafeTimerTask run Timer task hudson.model.Queue$MaintainTask@47ec5080 failed java.lang.ClassCastException: hudson.plugins.batch_task.BatchTask cannot be cast to hudson.model.AbstractProject at hudson.plugins.buildblocker.BuildBlockerQueueTaskDispatcher.getBuildBlockerProperty(BuildBlockerQueueTaskDispatcher.java:199) at hudson.plugins.buildblocker.BuildBlockerQueueTaskDispatcher.canTake(BuildBlockerQueueTaskDispatcher.java:108) at hudson.model.Queue$JobOffer.canTake(Queue.java:300) at hudson.model.Queue.maintain(Queue.java:1476) at hudson.model.Queue$MaintainTask.doRun(Queue.java:2576) at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:51) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) 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) {code} The behaviour is as follows: When starting a batch-task it istransferred into the build queue. After the time configured for waiting in this queue (in my installation that would be 2seconds) nothing happens... the task stays in the queue forever (and blocks other builds if there are no empty slots).
    via by Nikolaus Krismer,
  • Once we installed build-blocker-plugin 1.7.1, workflow jobs hung trying to allocate a node: {quote}Started by user Builder Running: Allocate node : Start Still waiting to schedule task Waiting for next available executor on node1.local{quote} When the workflow job hangs like this, not only is the step hung, but other unrelated jobs will queue up even if they aren't trying to run on the same node, i.e. if my workflow job depends on label 'feature' then even jobs which do not require 'feature' and would not build on a machine my workflow job would build on are also hung up. The jenkins log contains the following for each hung job: {quote}SEVERE: Timer task hudson.model.Queue$MaintainTask@6bb9a704 failed java.lang.ClassCastException: org.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution$PlaceholderTask cannot be cast to hudson.model.AbstractProject at hudson.plugins.buildblocker.BuildBlockerQueueTaskDispatcher.getBuildBlockerProperty(BuildBlockerQueueTaskDispatcher.java:199) at hudson.plugins.buildblocker.BuildBlockerQueueTaskDispatcher.canTake(BuildBlockerQueueTaskDispatcher.java:108) at hudson.model.Queue$JobOffer.canTake(Queue.java:299) at hudson.model.Queue.maintain(Queue.java:1355) at hudson.model.Queue$MaintainTask.doRun(Queue.java:2450) at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:51) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) {quote} Downgrading from build-blocker-plugin 1.7.1 to (in my case) 1.6 solved the problem.
    via by Will Saxon,
  • This workflow: {quote} node \{ echo "hello world" \} {quote} results in: {quote} Started by user anonymous [Workflow] Allocate node : Start Still waiting to schedule task Waiting for next available executor {quote} There are plenty of executors available, and other non-workflow jobs are able to allocate one. I see the same issue on separate similarly-configured Jenkins instances. Log: {quote} Dec 10 12:55:11 ip-172-29-0-82 [jenkins]: SEVERE: Timer task hudson.model.Queue$MaintainTask@2054b466 failed Dec 10 12:55:11 ip-172-29-0-82 [jenkins]: java.lang.ClassCastException: org.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution$PlaceholderTask cannot be cast to hudson.model.AbstractProject Dec 10 12:55:11 ip-172-29-0-82 [jenkins]: #011at hudson.plugins.buildblocker.BuildBlockerQueueTaskDispatcher.getBuildBlockerProperty(BuildBlockerQueueTaskDispatcher.java:199) Dec 10 12:55:11 ip-172-29-0-82 [jenkins]: #011at hudson.plugins.buildblocker.BuildBlockerQueueTaskDispatcher.canTake(BuildBlockerQueueTaskDispatcher.java:108) Dec 10 12:55:11 ip-172-29-0-82 [jenkins]: #011at hudson.model.Queue$JobOffer.canTake(Queue.java:301) Dec 10 12:55:11 ip-172-29-0-82 [jenkins]: #011at hudson.model.Queue.maintain(Queue.java:1544) Dec 10 12:55:11 ip-172-29-0-82 [jenkins]: #011at hudson.model.Queue$MaintainTask.doRun(Queue.java:2709) Dec 10 12:55:11 ip-172-29-0-82 [jenkins]: #011at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:51) Dec 10 12:55:11 ip-172-29-0-82 [jenkins]: #011at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) Dec 10 12:55:11 ip-172-29-0-82 [jenkins]: #011at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304) Dec 10 12:55:11 ip-172-29-0-82 [jenkins]: #011at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178) Dec 10 12:55:11 ip-172-29-0-82 [jenkins]: #011at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) Dec 10 12:55:11 ip-172-29-0-82 [jenkins]: #011at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) Dec 10 12:55:11 ip-172-29-0-82 [jenkins]: #011at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) Dec 10 12:55:11 ip-172-29-0-82 [jenkins]: #011at java.lang.Thread.run(Thread.java:745) {quote}
    via by Klaus Schniedergers,
    • java.lang.ClassCastException: com.cloudbees.jenkins.plugins.longrunning.BackgroundTask cannot be cast to hudson.model.AbstractProject at hudson.plugins.buildblocker.BuildBlockerQueueTaskDispatcher.getBuildBlockerProperty(BuildBlockerQueueTaskDispatcher.java:199) at hudson.plugins.buildblocker.BuildBlockerQueueTaskDispatcher.canTake(BuildBlockerQueueTaskDispatcher.java:108) at hudson.model.Queue$JobOffer.canTake(Queue.java:281) at hudson.model.Queue.maintain(Queue.java:1049) at hudson.model.Queue$MaintainTask.doRun(Queue.java:2033) at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:54) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)
    No Bugmate found.