java.lang.NoSuchMethodError: hudson.scm.SubversionSCM.getLocations(Lhudson/EnvVars;Lhudson/model/AbstractBuild;)[Lhudson/scm/SubversionSCM$ModuleLocation;

Jenkins JIRA | Anthony Mastrean | 1 year 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

    [JIRA] [svn-revert-plugin] (JENKINS-32308) NoSuchMethodError: hudson.scm.SubversionSCM.getLocations

    Google Groups | 1 year ago | anthony.mastrean@gmail.com (JIRA)
    java.lang.NoSuchMethodError: hudson.scm.SubversionSCM.getLocations(Lhudson/EnvVars;Lhudson/model/AbstractBuild;)[Lhudson/scm/SubversionSCM$ModuleLocation;
  2. 0

    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. {code} 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) {code} I looked at the [call site|https://github.com/jenkinsci/svn-revert-plugin/blob/master/src/main/java/jenkins/plugins/svn_revert/ModuleFinder.java#L29] from the revert plugin {code} subversionScm.getLocations(envVars, build) {code} And the method and [type signature|https://github.com/jenkinsci/subversion-plugin/blob/master/src/main/java/hudson/scm/SubversionSCM.java#L472] match in the Subversion plugin classes. {code} public ModuleLocation[] getLocations(EnvVars env, Run<?,?> build) {code} I also checked that an [AbstractBuild|http://javadoc.jenkins-ci.org/hudson/model/AbstractBuild.html] is a type of a Run, so that should be fine, right?

    Jenkins JIRA | 1 year ago | Anthony Mastrean
    java.lang.NoSuchMethodError: hudson.scm.SubversionSCM.getLocations(Lhudson/EnvVars;Lhudson/model/AbstractBuild;)[Lhudson/scm/SubversionSCM$ModuleLocation;
  3. 0

    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. {code} 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) {code} I looked at the [call site|https://github.com/jenkinsci/svn-revert-plugin/blob/master/src/main/java/jenkins/plugins/svn_revert/ModuleFinder.java#L29] from the revert plugin {code} subversionScm.getLocations(envVars, build) {code} And the method and [type signature|https://github.com/jenkinsci/subversion-plugin/blob/master/src/main/java/hudson/scm/SubversionSCM.java#L472] match in the Subversion plugin classes. {code} public ModuleLocation[] getLocations(EnvVars env, Run<?,?> build) {code} I also checked that an [AbstractBuild|http://javadoc.jenkins-ci.org/hudson/model/AbstractBuild.html] is a type of a Run, so that should be fine, right?

    Jenkins JIRA | 1 year ago | Anthony Mastrean
    java.lang.NoSuchMethodError: hudson.scm.SubversionSCM.getLocations(Lhudson/EnvVars;Lhudson/model/AbstractBuild;)[Lhudson/scm/SubversionSCM$ModuleLocation;
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NoSuchMethodError

      hudson.scm.SubversionSCM.getLocations(Lhudson/EnvVars;Lhudson/model/AbstractBuild;)[Lhudson/scm/SubversionSCM$ModuleLocation;

      at jenkins.plugins.svn_revert.ModuleFinder.getModules()
    2. jenkins.plugins.svn_revert
      JenkinsGlue.perform
      1. jenkins.plugins.svn_revert.ModuleFinder.getModules(ModuleFinder.java:29)
      2. jenkins.plugins.svn_revert.ChangeLocator.changedFilesMatchesModules(ChangeLocator.java:37)
      3. jenkins.plugins.svn_revert.ChangeLocator.changesOutsideWorkspace(ChangeLocator.java:29)
      4. jenkins.plugins.svn_revert.Bouncer.throwOutIfUnstable(Bouncer.java:46)
      5. jenkins.plugins.svn_revert.JenkinsGlue.perform(JenkinsGlue.java:52)
      5 frames
    3. Hudson
      Executor.run
      1. hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
      2. hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
      3. hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
      4. hudson.model.Build$BuildExecution.post2(Build.java:185)
      5. hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
      6. hudson.model.Run.execute(Run.java:1763)
      7. hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      8. hudson.model.ResourceController.execute(ResourceController.java:98)
      9. hudson.model.Executor.run(Executor.java:410)
      9 frames