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

ClassCastException while extracting e-mail author from

    Details

    • Similar Issues:

      Description

      We have this issue in our Hudson environment, that since we created some projects that use the GIT SCM plugin, any jobs that are using Subversion now report this exception. Somehow the GIT plugin seems to interfere with the build jobs that use subversion, even though the subversion jobs have no reference to GIT in their configuration.

      The problem happens when the Hudson job tries to extract e-mail information about SVN author: as there are different authors from both GIT and SVN in the overall Hudson jobs, it seems that all of them are assumed to come from SVN.

      See below the exception:

      java.lang.ClassCastException: hudson.plugins.git.GitSCM cannot be cast to hudson.scm.SubversionSCM
      at hudson.scm.SubversionChangeLogSet$LogEntry.preparePath(SubversionChangeLogSet.java:175)
      at hudson.scm.SubversionChangeLogSet$LogEntry.access$200(SubversionChangeLogSet.java:118)
      at hudson.scm.SubversionChangeLogSet$LogEntry$1.get(SubversionChangeLogSet.java:166)
      at hudson.scm.SubversionChangeLogSet$LogEntry$1.get(SubversionChangeLogSet.java:164)
      at java.util.AbstractList$Itr.next(AbstractList.java:345)
      at hudson.maven.MavenModuleSetBuild$1.isDescendantOf(MavenModuleSetBuild.java:200)
      at hudson.maven.MavenModuleSetBuild$1.<init>(MavenModuleSetBuild.java:170)
      at hudson.maven.MavenModuleSetBuild.getChangeSetFor(MavenModuleSetBuild.java:164)
      at hudson.maven.FilteredChangeLogSet.<init>(FilteredChangeLogSet.java:52)
      at hudson.maven.MavenBuild.getChangeSet(MavenBuild.java:159)
      at hudson.model.AbstractBuild.hasParticipant(AbstractBuild.java:314)
      at hudson.model.AbstractProject.hasParticipant(AbstractProject.java:1086)
      at hudson.model.User.getProjects(User.java:369)
      at hudson.tasks.MailAddressResolver$DefaultAddressResolver.findMailAddressFor(MailAddressResolver.java:148)
      at hudson.tasks.MailAddressResolver.resolve(MailAddressResolver.java:86)
      at hudson.tasks.Mailer$UserProperty.getAddress(Mailer.java:476)
      at hudson.tasks.MailSender.buildCulpritList(MailSender.java:344)
      at hudson.tasks.MailSender.createEmptyMail(MailSender.java:325)
      at hudson.tasks.MailSender.createUnstableMail(MailSender.java:167)
      at hudson.tasks.MailSender.getMail(MailSender.java:138)
      at hudson.tasks.MailSender.execute(MailSender.java:81)
      at hudson.maven.reporters.MavenMailer.end(MavenMailer.java:54)
      at hudson.maven.MavenModuleSetBuild$Builder.end(MavenModuleSetBuild.java:679)
      at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:483)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:383)
      at hudson.model.Run.run(Run.java:1174)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:304)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:123)
      project=hudson.maven.MavenModuleSet@18a0ac[Blueprint_2.0]
      project.getModules()=[hudson.maven.MavenModule@127ac1f[Blueprint_2.0/com.vodafone.global.dcs:blueprint]]
      project.getRootModule()=hudson.maven.MavenModule@127ac1f[Blueprint_2.0/com.vodafone.global.dcs:blueprint]
      FATAL: hudson.plugins.git.GitSCM cannot be cast to hudson.scm.SubversionSCM
      java.lang.ClassCastException: hudson.plugins.git.GitSCM cannot be cast to hudson.scm.SubversionSCM
      at hudson.scm.SubversionChangeLogSet$LogEntry.preparePath(SubversionChangeLogSet.java:175)
      at hudson.scm.SubversionChangeLogSet$LogEntry.access$200(SubversionChangeLogSet.java:118)
      at hudson.scm.SubversionChangeLogSet$LogEntry$1.get(SubversionChangeLogSet.java:166)
      at hudson.scm.SubversionChangeLogSet$LogEntry$1.get(SubversionChangeLogSet.java:164)
      at java.util.AbstractList$Itr.next(AbstractList.java:345)
      at hudson.maven.MavenModuleSetBuild$1.isDescendantOf(MavenModuleSetBuild.java:200)
      at hudson.maven.MavenModuleSetBuild$1.<init>(MavenModuleSetBuild.java:170)
      at hudson.maven.MavenModuleSetBuild.getChangeSetFor(MavenModuleSetBuild.java:164)
      at hudson.maven.FilteredChangeLogSet.<init>(FilteredChangeLogSet.java:52)
      at hudson.maven.MavenBuild.getChangeSet(MavenBuild.java:159)
      at hudson.model.AbstractBuild.hasParticipant(AbstractBuild.java:314)
      at hudson.model.AbstractProject.hasParticipant(AbstractProject.java:1086)
      at hudson.model.User.getProjects(User.java:369)
      at hudson.tasks.MailAddressResolver$DefaultAddressResolver.findMailAddressFor(MailAddressResolver.java:148)
      at hudson.tasks.MailAddressResolver.resolve(MailAddressResolver.java:86)
      at hudson.tasks.Mailer$UserProperty.getAddress(Mailer.java:476)
      at hudson.tasks.MailSender.buildCulpritList(MailSender.java:344)
      at hudson.tasks.MailSender.createEmptyMail(MailSender.java:325)
      at hudson.tasks.MailSender.createUnstableMail(MailSender.java:167)
      at hudson.tasks.MailSender.getMail(MailSender.java:138)
      at hudson.tasks.MailSender.execute(MailSender.java:81)
      at hudson.maven.reporters.MavenMailer.end(MavenMailer.java:54)
      at hudson.maven.MavenModuleSetBuild$Builder.end(MavenModuleSetBuild.java:679)
      at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:483)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:383)
      at hudson.model.Run.run(Run.java:1174)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:304)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:123)

      Versions

         * Hudson: 1.346
         * Ubuntu 8.04 (linux kernel 2.6.24-19-generic), 32 bit, i686.
         * Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
           Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode)
         * Subversion Plugin 1.8
         * Hudson GIT plugin 0.8

      As an addition info, we have a similar exception if we browse the list of people from Hudson:

      exception

      javax.servlet.ServletException: java.lang.ClassCastException: hudson.plugins.git.GitSCM cannot be cast to hudson.scm.SubversionSCM
      org.kohsuke.stapler.Stapler.invoke(Stapler.java:554)
      org.kohsuke.stapler.Stapler.invoke(Stapler.java:435)
      org.kohsuke.stapler.Stapler.service(Stapler.java:123)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:94)
      hudson.plugins.collabnet.auth.CNFilter.doFilter(CNFilter.java:72)
      hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:97)
      hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:86)
      hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47)
      hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
      hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
      hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166)
      hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
      hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
      hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173)
      hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
      hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66)
      hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
      hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)

      root cause

      java.lang.ClassCastException: hudson.plugins.git.GitSCM cannot be cast to hudson.scm.SubversionSCM
      hudson.scm.SubversionChangeLogSet$LogEntry.preparePath(SubversionChangeLogSet.java:175)
      hudson.scm.SubversionChangeLogSet$LogEntry.access$200(SubversionChangeLogSet.java:118)
      hudson.scm.SubversionChangeLogSet$LogEntry$1.get(SubversionChangeLogSet.java:166)
      hudson.scm.SubversionChangeLogSet$LogEntry$1.get(SubversionChangeLogSet.java:164)
      java.util.AbstractList$Itr.next(AbstractList.java:345)
      hudson.maven.MavenModuleSetBuild$1.isDescendantOf(MavenModuleSetBuild.java:200)
      hudson.maven.MavenModuleSetBuild$1.<init>(MavenModuleSetBuild.java:170)
      hudson.maven.MavenModuleSetBuild.getChangeSetFor(MavenModuleSetBuild.java:164)
      hudson.maven.FilteredChangeLogSet.<init>(FilteredChangeLogSet.java:52)
      hudson.maven.MavenBuild.getChangeSet(MavenBuild.java:159)
      hudson.model.View$People.getUserInfo(View.java:480)
      hudson.model.View$People.<init>(View.java:458)
      hudson.model.Hudson.getPeople(Hudson.java:769)
      sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      java.lang.reflect.Method.invoke(Method.java:597)
      org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:185)
      org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:144)
      org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30)
      org.kohsuke.stapler.Stapler.invoke(Stapler.java:519)
      org.kohsuke.stapler.Stapler.invoke(Stapler.java:435)
      org.kohsuke.stapler.Stapler.service(Stapler.java:123)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:94)
      hudson.plugins.collabnet.auth.CNFilter.doFilter(CNFilter.java:72)
      hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:97)
      hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:86)
      hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47)
      hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
      hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
      hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166)
      hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
      hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
      hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173)
      hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
      hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66)
      hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
      hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)

        Attachments

          Activity

          Hide
          mindless Alan Harder added a comment -

          1) do you see any exceptions like this that are not for maven project?
          2) look in the builds/*/changelog.xml files for some of your maven projects.. can you find any that contain "subversion" but the maven project uses Git for its SCM?

          did you have any projects that once used subversion but then you changed the SCM to git?

          Show
          mindless Alan Harder added a comment - 1) do you see any exceptions like this that are not for maven project? 2) look in the builds/*/changelog.xml files for some of your maven projects.. can you find any that contain "subversion" but the maven project uses Git for its SCM? did you have any projects that once used subversion but then you changed the SCM to git?
          Hide
          thoraage thoraage added a comment - - edited

          I experienced the same exception after moving a project from Subversion to Git. I reconfigured it by changing the SCM from Subversion to Git. After that I got the exception when entering the People page. I resolved the problem by deleting the job and creating a new.

          Show
          thoraage thoraage added a comment - - edited I experienced the same exception after moving a project from Subversion to Git. I reconfigured it by changing the SCM from Subversion to Git. After that I got the exception when entering the People page. I resolved the problem by deleting the job and creating a new.
          Hide
          lucamilanesio Luca Domenico Milanesio added a comment -

          Hi,

          it is actually the case: the jobs were originally using SVN and then they have been moved to GIT.
          Anyway this is a fairly common scenario as people will be moving from SVN to GIT: is there an assumption that a Project cannot change its SCM in his history then ?

          May I go and fix this without opening any "Pandorra vase" ?

          Thank you for your help.

          Luca.

          Show
          lucamilanesio Luca Domenico Milanesio added a comment - Hi, it is actually the case: the jobs were originally using SVN and then they have been moved to GIT. Anyway this is a fairly common scenario as people will be moving from SVN to GIT: is there an assumption that a Project cannot change its SCM in his history then ? May I go and fix this without opening any "Pandorra vase" ? Thank you for your help. Luca.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in hudson
          User: : mindless
          Path:
          trunk/hudson/plugins/subversion/src/main/java/hudson/scm/SubversionChangeLogSet.java
          http://jenkins-ci.org/commit/28178
          Log:
          [FIXED JENKINS-5705] Don't assume project still has SubversionSCM configured

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : mindless Path: trunk/hudson/plugins/subversion/src/main/java/hudson/scm/SubversionChangeLogSet.java http://jenkins-ci.org/commit/28178 Log: [FIXED JENKINS-5705] Don't assume project still has SubversionSCM configured

            People

            • Assignee:
              mindless Alan Harder
              Reporter:
              lucamilanesio Luca Domenico Milanesio
            • Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: