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

NoSuchMethodError: hudson.scm.SubversionSCM.getLocations

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • svn-revert-plugin
    • None
    • Jenkins 1.643
      Subversion Plugin 2.5.6
      Subversion Revert Plugin 1.3

      I was testing this plugin's capabilities. I configured a build that always returns unstable, just to see what happens. Except, the revert plugin throws an exception immediately.

      ERROR: Step ‘Reverts commits that breaks the build’ aborted due to exception: 
      java.lang.NoSuchMethodError: hudson.scm.SubversionSCM.getLocations(Lhudson/EnvVars;Lhudson/model/AbstractBuild;)[Lhudson/scm/SubversionSCM$ModuleLocation;
      	at jenkins.plugins.svn_revert.ModuleFinder.getModules(ModuleFinder.java:29)
      	at jenkins.plugins.svn_revert.ChangeLocator.changedFilesMatchesModules(ChangeLocator.java:37)
      	at jenkins.plugins.svn_revert.ChangeLocator.changesOutsideWorkspace(ChangeLocator.java:29)
      	at jenkins.plugins.svn_revert.Bouncer.throwOutIfUnstable(Bouncer.java:46)
      	at jenkins.plugins.svn_revert.JenkinsGlue.perform(JenkinsGlue.java:52)
      	at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
      	at hudson.model.Build$BuildExecution.post2(Build.java:185)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
      	at hudson.model.Run.execute(Run.java:1763)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:410)
      

      I looked at the call site from the revert plugin

      subversionScm.getLocations(envVars, build)
      

      And the method and type signature match in the Subversion plugin classes.

      public ModuleLocation[] getLocations(EnvVars env, Run<?,?> build)
      

      I also checked that an AbstractBuild is a type of a Run, so that should be fine, right?

          [JENKINS-32308] NoSuchMethodError: hudson.scm.SubversionSCM.getLocations

          Yes, as far as I can see everything looks fine. Have you tried running this with as few other plugins enabled as possible?

          I'm not actively maintaining this plugin, so I have not tried this plugin on any recent Jenkins version.

          David Pärsson added a comment - Yes, as far as I can see everything looks fine. Have you tried running this with as few other plugins enabled as possible? I'm not actively maintaining this plugin, so I have not tried this plugin on any recent Jenkins version.

          Yikes, it is not trivial to upgrade the dependencies and jenkins-core version. So much has changed with the various APIs. I'm currently stuck on this HudsonTestCase vs. JenkinsRule nonsense.

          fork: https://github.com/AnthonyMastrean/svn-revert-plugin/
          build: ttps://travis-ci.org/AnthonyMastrean/svn-revert-plugin
          docs: https://wiki.jenkins-ci.org/display/JENKINS/Unit+Test#UnitTest-HudsonTestCase%28JUnit3%29

          Anthony Mastrean added a comment - Yikes, it is not trivial to upgrade the dependencies and jenkins-core version. So much has changed with the various APIs. I'm currently stuck on this HudsonTestCase vs. JenkinsRule nonsense. fork: https://github.com/AnthonyMastrean/svn-revert-plugin/ build: ttps://travis-ci.org/AnthonyMastrean/svn-revert-plugin docs: https://wiki.jenkins-ci.org/display/JENKINS/Unit+Test#UnitTest-HudsonTestCase%28JUnit3%29

            Unassigned Unassigned
            anthonymastrean Anthony Mastrean
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: