Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-16917

status 500 when trying to save build configuration

    Details

    • Similar Issues:

      Description

      When trying to use downstream-ext plug job cannot be saved with and the following error is generated:

      Status Code: 500

      Exception: java.lang.ClassCastException: hudson.plugins.downstream_ext.DownstreamTrigger cannot be cast to hudson.tasks.BuildTrigger
      Stacktrace:
      javax.servlet.ServletException: java.lang.ClassCastException: hudson.plugins.downstream_ext.DownstreamTrigger cannot be cast to hudson.tasks.BuildTrigger
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:615)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:658)
      at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:241)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:573)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:658)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:487)
      at org.kohsuke.stapler.Stapler.service(Stapler.java:164)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)
      at winstone.ServletConfiguration.execute(ServletConfiguration.java:248)
      at winstone.RequestDispatcher.forward(RequestDispatcher.java:333)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:376)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:95)
      at hudson.plugins.scm_sync_configuration.extensions.ScmSyncConfigurationFilter$1.call(ScmSyncConfigurationFilter.java:36)
      at hudson.plugins.scm_sync_configuration.ScmSyncConfigurationDataProvider.provideRequestDuring(ScmSyncConfigurationDataProvider.java:103)
      at hudson.plugins.scm_sync_configuration.extensions.ScmSyncConfigurationFilter.doFilter(ScmSyncConfigurationFilter.java:32)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:98)
      at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:87)
      at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
      at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47)
      at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
      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 winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
      at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:50)
      at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
      at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
      at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
      at winstone.RequestDispatcher.forward(RequestDispatcher.java:331)
      at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:227)
      at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
      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:680)
      Caused by: java.lang.ClassCastException: hudson.plugins.downstream_ext.DownstreamTrigger cannot be cast to hudson.tasks.BuildTrigger
      at hudson.model.AbstractProject.submit(AbstractProject.java:1919)
      at hudson.model.Project.submit(Project.java:195)
      at hudson.model.Job.doConfigSubmit(Job.java:1045)
      at hudson.model.AbstractProject.doConfigSubmit(AbstractProject.java:740)
      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 org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:288)
      at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:151)
      at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:90)
      at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:111)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      at org.kohsuke.sta

        Attachments

          Activity

          Show
          kutzi kutzi added a comment - Caused by core commit https://github.com/jenkinsci/jenkins/commit/36342d71e29e0620f803a7470ce96c61761648d8
          Hide
          jglick Jesse Glick added a comment -

          I do not think there is anything wrong with the core code. I did try to make BuildTrigger.DescriptorImpl be more type-safe so that it would restrict the instances to subtypes of BuildTrigger but this did not type-check for complex reasons (i.e. Jenkins abuses Java generics). Probably BuildTrigger.DescriptorImpl should just be final.

          Show
          jglick Jesse Glick added a comment - I do not think there is anything wrong with the core code. I did try to make BuildTrigger.DescriptorImpl be more type-safe so that it would restrict the instances to subtypes of BuildTrigger but this did not type-check for complex reasons (i.e. Jenkins abuses Java generics). Probably BuildTrigger.DescriptorImpl should just be final.
          Hide
          kutzi kutzi added a comment -

          The problem with DownstreamTrigger is that it uses a subtype of BuildTrigger.DescriptorImpl as its descriptor, but is no subtype of BuildTrigger itself.

          I see now that that was a bad idea and am fixing it.

          Show
          kutzi kutzi added a comment - The problem with DownstreamTrigger is that it uses a subtype of BuildTrigger.DescriptorImpl as its descriptor, but is no subtype of BuildTrigger itself. I see now that that was a bad idea and am fixing it.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Jesse Glick
          Path:
          core/src/main/java/hudson/tasks/BuildTrigger.java
          http://jenkins-ci.org/commit/jenkins/fd0657ef9e34f8ce9c8802babec3873f8133ca99
          Log:
          JENKINS-16917 hudson.plugins.downstream_ext.DownstreamTrigger.DescriptorImpl should not be extending BuildTrigger.DescriptorImpl since it does not produce a BuildTrigger from newInstance.
          (Generally there is no reason to subclass a Descriptor type which is already an @Extension rather than an explicit abstract supertype, but this is a bit more conservative change than just making it final.)


          You received this message because you are subscribed to the Google Groups "Jenkins Commits" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com.
          For more options, visit https://groups.google.com/groups/opt_out.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/hudson/tasks/BuildTrigger.java http://jenkins-ci.org/commit/jenkins/fd0657ef9e34f8ce9c8802babec3873f8133ca99 Log: JENKINS-16917 hudson.plugins.downstream_ext.DownstreamTrigger.DescriptorImpl should not be extending BuildTrigger.DescriptorImpl since it does not produce a BuildTrigger from newInstance. (Generally there is no reason to subclass a Descriptor type which is already an @Extension rather than an explicit abstract supertype, but this is a bit more conservative change than just making it final.) – You received this message because you are subscribed to the Google Groups "Jenkins Commits" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out .
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          src/main/java/hudson/plugins/downstream_ext/DownstreamTrigger.java
          src/main/resources/hudson/plugins/downstream_ext/DownstreamTrigger/config.jelly
          http://jenkins-ci.org/commit/downstream-ext-plugin/a695bc2741ec539684ce4ad31b28f47de9f7371e
          Log:
          [FIXED JENKINS-16917] do not extends BuildTrigger.DescriptorImpl

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: src/main/java/hudson/plugins/downstream_ext/DownstreamTrigger.java src/main/resources/hudson/plugins/downstream_ext/DownstreamTrigger/config.jelly http://jenkins-ci.org/commit/downstream-ext-plugin/a695bc2741ec539684ce4ad31b28f47de9f7371e Log: [FIXED JENKINS-16917] do not extends BuildTrigger.DescriptorImpl
          Hide
          dogfood dogfood added a comment -

          Integrated in jenkins_main_trunk #2289
          JENKINS-16917 hudson.plugins.downstream_ext.DownstreamTrigger.DescriptorImpl should not be extending BuildTrigger.DescriptorImpl since it does not produce a BuildTrigger from newInstance. (Revision fd0657ef9e34f8ce9c8802babec3873f8133ca99)

          Result = UNSTABLE
          Jesse Glick : fd0657ef9e34f8ce9c8802babec3873f8133ca99
          Files :

          • core/src/main/java/hudson/tasks/BuildTrigger.java
          Show
          dogfood dogfood added a comment - Integrated in jenkins_main_trunk #2289 JENKINS-16917 hudson.plugins.downstream_ext.DownstreamTrigger.DescriptorImpl should not be extending BuildTrigger.DescriptorImpl since it does not produce a BuildTrigger from newInstance. (Revision fd0657ef9e34f8ce9c8802babec3873f8133ca99) Result = UNSTABLE Jesse Glick : fd0657ef9e34f8ce9c8802babec3873f8133ca99 Files : core/src/main/java/hudson/tasks/BuildTrigger.java

            People

            • Assignee:
              kutzi kutzi
              Reporter:
              ramzez ramzez ramzez
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: