java.lang.ClassCastException: hudson.matrix.MatrixConfiguration cannot be cast to hudson.model.TopLevelItem

Jenkins JIRA | Thomas Fields | 5 years ago
  1. 0

    Currently, {{list-jobs}} command tries to list any {{ItemGroups}} (including {{MavenModuleSet}} or {{MatrixProject}} which does not make sense). It should list instances of {{View}} and {{ItemGroup<? extends TopLevelItem>}} exclusively. {{jenkins-cli.jar list-jobs MyMatrixJob}} fails with: {noformat} java.lang.ClassCastException: hudson.matrix.MatrixConfiguration cannot be cast to hudson.model.TopLevelItem at hudson.cli.ListJobsCommand.run(ListJobsCommand.java:88) at hudson.cli.CLICommand.main(CLICommand.java:229) at hudson.cli.CliManagerImpl.main(CliManagerImpl.java:92) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:282) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:263) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:222) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at hudson.cli.CliManagerImpl$1.call(CliManagerImpl.java:63) at hudson.remoting.InterceptingExecutorService$2.call(InterceptingExecutorService.java:95) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:662) {noformat}

    Jenkins JIRA | 3 years ago | Oliver Gondža
    java.lang.ClassCastException: hudson.matrix.MatrixConfiguration cannot be cast to hudson.model.TopLevelItem
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    Get internal server error (500) when attempting to get views

    GitHub | 3 years ago | dhumeniuk
    java.io.IOException: Failed to write jobs
  4. 0

    Currently, {{list-jobs}} command tries to list any {{ItemGroups}} (including {{MavenModuleSet}} or {{MatrixProject}} which does not make sense). It should list instances of {{View}} and {{ItemGroup<? extends TopLevelItem>}} exclusively. {{jenkins-cli.jar list-jobs MyMatrixJob}} fails with: {noformat} java.lang.ClassCastException: hudson.matrix.MatrixConfiguration cannot be cast to hudson.model.TopLevelItem at hudson.cli.ListJobsCommand.run(ListJobsCommand.java:88) at hudson.cli.CLICommand.main(CLICommand.java:229) at hudson.cli.CliManagerImpl.main(CliManagerImpl.java:92) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:282) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:263) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:222) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at hudson.cli.CliManagerImpl$1.call(CliManagerImpl.java:63) at hudson.remoting.InterceptingExecutorService$2.call(InterceptingExecutorService.java:95) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:662) {noformat}

    Jenkins JIRA | 3 years ago | Oliver Gondža
    java.lang.ClassCastException: hudson.matrix.MatrixConfiguration cannot be cast to hudson.model.TopLevelItem

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ClassCastException

      hudson.matrix.MatrixConfiguration cannot be cast to hudson.model.TopLevelItem

      at hudson.plugins.lockedfilesreport.LockedFilesReporter.checkForFileUsage()
    2. hudson.plugins.lockedfilesreport
      LockedFilesReporter.prebuild
      1. hudson.plugins.lockedfilesreport.LockedFilesReporter.checkForFileUsage(LockedFilesReporter.java:79)
      2. hudson.plugins.lockedfilesreport.LockedFilesReporter.prebuild(LockedFilesReporter.java:53)
      2 frames
    3. Hudson
      Executor.run
      1. hudson.model.AbstractBuild$AbstractRunner.preBuild(AbstractBuild.java:675)
      2. hudson.model.AbstractBuild$AbstractRunner.preBuild(AbstractBuild.java:670)
      3. hudson.model.AbstractBuild$AbstractRunner.preBuild(AbstractBuild.java:666)
      4. hudson.model.Build$RunnerImpl.doRun(Build.java:121)
      5. hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:429)
      6. hudson.model.Run.run(Run.java:1374)
      7. hudson.matrix.MatrixRun.run(MatrixRun.java:137)
      8. hudson.model.ResourceController.execute(ResourceController.java:88)
      9. hudson.model.Executor.run(Executor.java:145)
      9 frames