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

ClassCastException while extracting e-mail author from

    XMLWordPrintable

Details

    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

          lucamilanesio Luca Domenico Milanesio created issue -
          mindless Alan Harder made changes -
          Field Original Value New Value
          Assignee jbq [ jbq ] mindless [ mindless ]
          mindless Alan Harder made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          scm_issue_link SCM/JIRA link daemon made changes -
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Resolved [ 5 ]
          abayer Andrew Bayer made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 135797 ] JNJira + In-Review [ 203679 ]

          People

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

            Dates

              Created:
              Updated:
              Resolved: