javax.servlet.ServletException: java.lang.ClassCastException: hudson.slaves.SlaveComputer cannot be cast to hudson.slaves.AbstractCloudComputer

Jenkins JIRA | Oliver Gondža | 2 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Can be reproduced with {{mvn hpi:run}}. Create new slave, hit save. {noformat} javax.servlet.ServletException: java.lang.ClassCastException: hudson.slaves.SlaveComputer cannot be cast to hudson.slaves.AbstractCloudComputer at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:783) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:863) at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:210) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:733) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:863) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:636) at org.kohsuke.stapler.Stapler.service(Stapler.java:225) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1074) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:96) at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:88) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065) at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:48) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84) at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76) at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065) at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:46) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065) at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:146) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) at org.mortbay.jetty.Server.handle(Server.java:285) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:765) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:628) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475) Caused by: java.lang.ClassCastException: hudson.slaves.SlaveComputer cannot be cast to hudson.slaves.AbstractCloudComputer at com.nirima.jenkins.plugins.docker.strategy.DockerOnceRetentionStrategy.start(DockerOnceRetentionStrategy.java:29) at hudson.model.AbstractCIBase.updateComputer(AbstractCIBase.java:129) at hudson.model.AbstractCIBase.updateComputerList(AbstractCIBase.java:179) at jenkins.model.Jenkins.updateComputerList(Jenkins.java:1220) at jenkins.model.Jenkins.setNodes(Jenkins.java:1717) at jenkins.model.Jenkins.addNode(Jenkins.java:1699) at hudson.model.ComputerSet.doDoCreateItem(ComputerSet.java:294) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:298) at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:161) at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96) at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:120) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:733) ... 39 more {noformat}

    Jenkins JIRA | 2 years ago | Oliver Gondža
    javax.servlet.ServletException: java.lang.ClassCastException: hudson.slaves.SlaveComputer cannot be cast to hudson.slaves.AbstractCloudComputer
  2. 0

    Can be reproduced with {{mvn hpi:run}}. Create new slave, hit save. {noformat} javax.servlet.ServletException: java.lang.ClassCastException: hudson.slaves.SlaveComputer cannot be cast to hudson.slaves.AbstractCloudComputer at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:783) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:863) at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:210) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:733) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:863) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:636) at org.kohsuke.stapler.Stapler.service(Stapler.java:225) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1074) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:96) at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:88) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065) at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:48) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84) at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76) at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065) at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:46) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065) at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:146) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) at org.mortbay.jetty.Server.handle(Server.java:285) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:765) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:628) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475) Caused by: java.lang.ClassCastException: hudson.slaves.SlaveComputer cannot be cast to hudson.slaves.AbstractCloudComputer at com.nirima.jenkins.plugins.docker.strategy.DockerOnceRetentionStrategy.start(DockerOnceRetentionStrategy.java:29) at hudson.model.AbstractCIBase.updateComputer(AbstractCIBase.java:129) at hudson.model.AbstractCIBase.updateComputerList(AbstractCIBase.java:179) at jenkins.model.Jenkins.updateComputerList(Jenkins.java:1220) at jenkins.model.Jenkins.setNodes(Jenkins.java:1717) at jenkins.model.Jenkins.addNode(Jenkins.java:1699) at hudson.model.ComputerSet.doDoCreateItem(ComputerSet.java:294) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:298) at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:161) at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96) at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:120) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:733) ... 39 more {noformat}

    Jenkins JIRA | 2 years ago | Oliver Gondža
    javax.servlet.ServletException: java.lang.ClassCastException: hudson.slaves.SlaveComputer cannot be cast to hudson.slaves.AbstractCloudComputer

    Root Cause Analysis

    1. java.lang.ClassCastException

      hudson.slaves.SlaveComputer cannot be cast to hudson.slaves.AbstractCloudComputer

      at com.nirima.jenkins.plugins.docker.strategy.DockerOnceRetentionStrategy.start()
    2. com.nirima.jenkins
      DockerOnceRetentionStrategy.start
      1. com.nirima.jenkins.plugins.docker.strategy.DockerOnceRetentionStrategy.start(DockerOnceRetentionStrategy.java:29)
      1 frame
    3. Hudson
      AbstractCIBase.updateComputerList
      1. hudson.model.AbstractCIBase.updateComputer(AbstractCIBase.java:129)
      2. hudson.model.AbstractCIBase.updateComputerList(AbstractCIBase.java:179)
      2 frames
    4. jenkins.model
      Jenkins.addNode
      1. jenkins.model.Jenkins.updateComputerList(Jenkins.java:1220)
      2. jenkins.model.Jenkins.setNodes(Jenkins.java:1717)
      3. jenkins.model.Jenkins.addNode(Jenkins.java:1699)
      3 frames
    5. Hudson
      ComputerSet.doDoCreateItem
      1. hudson.model.ComputerSet.doDoCreateItem(ComputerSet.java:294)
      1 frame
    6. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:606)
      4 frames
    7. Stapler
      Stapler.service
      1. org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:298)
      2. org.kohsuke.stapler.Function.bindAndInvoke(Function.java:161)
      3. org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96)
      4. org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:120)
      5. org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      6. org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:733)
      7. org.kohsuke.stapler.Stapler.invoke(Stapler.java:863)
      8. org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:210)
      9. org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      10. org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:733)
      11. org.kohsuke.stapler.Stapler.invoke(Stapler.java:863)
      12. org.kohsuke.stapler.Stapler.invoke(Stapler.java:636)
      13. org.kohsuke.stapler.Stapler.service(Stapler.java:225)
      13 frames
    8. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      1 frame
    9. Jetty Server
      ServletHandler$CachedChain.doFilter
      1. org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)
      2. org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1074)
      2 frames
    10. Hudson
      PluginServletFilter.doFilter
      1. hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:96)
      2. hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:88)
      2 frames
    11. Jetty Server
      ServletHandler$CachedChain.doFilter
      1. org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
      1 frame
    12. Hudson
      CrumbFilter.doFilter
      1. hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:48)
      1 frame
    13. Jetty Server
      ServletHandler$CachedChain.doFilter
      1. org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
      1 frame
    14. Hudson
      HudsonFilter.doFilter
      1. hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
      2. hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
      3. hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
      3 frames
    15. Jetty Server
      ServletHandler$CachedChain.doFilter
      1. org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
      1 frame
    16. Stapler
      CompressionFilter.doFilter
      1. org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:46)
      1 frame
    17. Jetty Server
      ServletHandler$CachedChain.doFilter
      1. org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
      1 frame
    18. Hudson
      CharacterEncodingFilter.doFilter
      1. hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
      1 frame
    19. Jetty Server
      SelectChannelEndPoint.run
      1. org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
      2. org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
      3. org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
      4. org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
      5. org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
      6. org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
      7. org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:146)
      8. org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
      9. org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
      10. org.mortbay.jetty.Server.handle(Server.java:285)
      11. org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)
      12. org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:765)
      13. org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:628)
      14. org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
      15. org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
      16. org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329)
      16 frames
    20. Jetty Util
      BoundedThreadPool$PoolThread.run
      1. org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
      1 frame