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

java.lang.NoSuchMethodError on OSX

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • gerrit-trigger-plugin

      I'm developing a plugin (https://github.com/zaro0508/verify-status-reporter) on my MAC. When I debug and run this plugin using hpi:run it works fine. When I run jenkins with `java -jar jenkins.war` install the plugin then I get a runtime error (java.lang.NoSuchMethodError). This error happens on my MAC. However when I run it the exact same way on Ubuntu Xenial `java -jar jenkins.war` then it work fine. I think there's something screwy with the classloading on OSX.

      I notice the error will not happen if I depend on the Jenkins plugin parent pom ver 1.580.1 but when I switch to ver 2.7 to match the Gerrit trigger plugin the problem happens. The dependency is looks like this..

      <parent>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>plugin</artifactId>
      <version>2.7</version>
      <relativePath />
      </parent>

      here is the stack trace..

      INFO: All Builds are completed for cause: GerritCause: com.sonymobile.tools.gerrit.gerritevents.dto.events.CommentAdded@704e521 silent: false
      Sep 02, 2016 10:49:23 AM hudson.model.AbstractBuild$AbstractBuildExecution reportError
      WARNING: Step ‘Post Verification to Gerrit’ aborted due to exception:
      java.lang.NoSuchMethodError: com.google.gerrit.extensions.api.changes.RevisionApi.verifyStatus()Lcom/google/gerrit/extensions/api/changes/VerifyStatusApi;
      at org.jenkinsci.plugins.verifystatus.VerificationsPublisher.perform(VerificationsPublisher.java:174)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
      at hudson.model.Build$BuildExecution.cleanUp(Build.java:195)
      at hudson.model.Run.execute(Run.java:1788)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:408)

            rsandell rsandell
            zaro0508 Khai Do
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: