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

Jenkins JIRA | Oliver Gondža | 3 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. 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
  3. 0

    [JENKINS-10119] Cant build jenkins from source on debian squeeze - Jenkins JIRA

    jenkins-ci.org | 4 months ago
    java.lang.ClassCastException: java.lang.String cannot be cast to org.acegisecurity.userdetails.UserDetails
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

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

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

    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.cli.ListJobsCommand.run()
    2. Hudson
      CliManagerImpl.main
      1. hudson.cli.ListJobsCommand.run(ListJobsCommand.java:88)
      2. hudson.cli.CLICommand.main(CLICommand.java:229)
      3. hudson.cli.CliManagerImpl.main(CliManagerImpl.java:92)
      3 frames
    3. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:597)
      4 frames
    4. Hudson :: Remoting Layer
      InterceptingExecutorService$1.call
      1. hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:282)
      2. hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:263)
      3. hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:222)
      4. hudson.remoting.UserRequest.perform(UserRequest.java:118)
      5. hudson.remoting.UserRequest.perform(UserRequest.java:48)
      6. hudson.remoting.Request$2.run(Request.java:326)
      7. hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      7 frames
    5. Hudson
      CliManagerImpl$1.call
      1. hudson.cli.CliManagerImpl$1.call(CliManagerImpl.java:63)
      1 frame
    6. Hudson :: Remoting Layer
      InterceptingExecutorService$2.call
      1. hudson.remoting.InterceptingExecutorService$2.call(InterceptingExecutorService.java:95)
      1 frame
    7. Java RT
      Thread.run
      1. java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      2. java.util.concurrent.FutureTask.run(FutureTask.java:138)
      3. java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
      4. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
      5. java.lang.Thread.run(Thread.java:662)
      5 frames