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

NotExportableException in hudson.plugins.git.opt.PreBuildMergeOptions on job/(.*)/api/(.*)?depth=1

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • git-plugin
    • None

      Git Plugin Version: 1.1.9

      A remote-api call such as http://$hudson_host/job/$job_name/api/xml?depth=1 results in:

      javax.servlet.ServletException: org.kohsuke.stapler.export.NotExportableException: class hudson.plugins.git.opt.PreBuildMergeOptions doesn't have @ExportedBean
      org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:603)
      org.kohsuke.stapler.Stapler.invoke(Stapler.java:646)
      org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:195)
      org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:561)
      org.kohsuke.stapler.Stapler.invoke(Stapler.java:646)
      org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:233)
      org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:561)
      org.kohsuke.stapler.Stapler.invoke(Stapler.java:646)
      org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:233)
      org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:561)
      org.kohsuke.stapler.Stapler.invoke(Stapler.java:646)
      org.kohsuke.stapler.Stapler.invoke(Stapler.java:477)
      org.kohsuke.stapler.Stapler.service(Stapler.java:159)
      ...

      http://$hudson_host/job/$job_name/api/xml?depth=0 - works
      http://$hudson_host/job/$job_name/$build_number/api/xml - works for all builds

          [JENKINS-9843] NotExportableException in hudson.plugins.git.opt.PreBuildMergeOptions on job/(.*)/api/(.*)?depth=1

          I've just committed 0007bab4d3ca27f20d7d69ca870e8d57b4e3ebfa and b1db233fa2b32f01c46b5a561fa3bbc16f0ae68b to help with this.

          Also see https://wiki.jenkins-ci.org/display/JENKINS/Hint+on+retaining+backward+compatibility

          Kohsuke Kawaguchi added a comment - I've just committed 0007bab4d3ca27f20d7d69ca870e8d57b4e3ebfa and b1db233fa2b32f01c46b5a561fa3bbc16f0ae68b to help with this. Also see https://wiki.jenkins-ci.org/display/JENKINS/Hint+on+retaining+backward+compatibility

          Kevin Sawicki added a comment - - edited

          Created pull request with potential fix: https://github.com/jenkinsci/git-plugin/pull/33

          Kevin Sawicki added a comment - - edited Created pull request with potential fix: https://github.com/jenkinsci/git-plugin/pull/33

          Kevin Sawicki added a comment -

          The conversion exception with the ObjectId class should now be fixed by this commit

          Kevin Sawicki added a comment - The conversion exception with the ObjectId class should now be fixed by this commit

          vjuranek added a comment -

          Another pull request related to this issue (fixed NPE): https://github.com/jenkinsci/git-plugin/pull/35

          vjuranek added a comment - Another pull request related to this issue (fixed NPE): https://github.com/jenkinsci/git-plugin/pull/35

          Peter Fern added a comment -

          I haven't tried with vjuranek's patch, but prior to that, working around the NPE by filling in mergeRemote/mergeTarget (which incidentally are never retained in the UI), I then get the attached stack trace, so looks like there are more depths to plumb here?

          [Winstone 2011/06/21 16:06:09] - Untrapped Error in Servlet
          javax.servlet.ServletException: org.kohsuke.stapler.export.NotExportableException: class org.eclipse.jgit.transport.RemoteConfig doesn't have @ExportedBean
          at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:603)

          Peter Fern added a comment - I haven't tried with vjuranek's patch, but prior to that, working around the NPE by filling in mergeRemote/mergeTarget (which incidentally are never retained in the UI), I then get the attached stack trace, so looks like there are more depths to plumb here? [Winstone 2011/06/21 16:06:09] - Untrapped Error in Servlet javax.servlet.ServletException: org.kohsuke.stapler.export.NotExportableException: class org.eclipse.jgit.transport.RemoteConfig doesn't have @ExportedBean at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:603)

          Code changed in jenkins
          User: Andrew Bayer
          Path:
          src/main/java/hudson/plugins/git/opt/PreBuildMergeOptions.java
          http://jenkins-ci.org/commit/git-plugin/b3ea09ea4d25177f06d8cd29d275991fc386e2ae
          Log:
          Merge pull request #35 from vjuranek/JENKINS-9843

          [FIXED JENKINS-9843] Fixed NPE

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: src/main/java/hudson/plugins/git/opt/PreBuildMergeOptions.java http://jenkins-ci.org/commit/git-plugin/b3ea09ea4d25177f06d8cd29d275991fc386e2ae Log: Merge pull request #35 from vjuranek/ JENKINS-9843 [FIXED JENKINS-9843] Fixed NPE

          Jesse Glick added a comment -

          The original error was never actually fixed. I just pushed a fix. The JIRA link daemon must have been down, so: https://github.com/jenkinsci/git-plugin/commit/ec813101f6667a34b75775a600906a09b3f75b6b

          Jesse Glick added a comment - The original error was never actually fixed. I just pushed a fix. The JIRA link daemon must have been down, so: https://github.com/jenkinsci/git-plugin/commit/ec813101f6667a34b75775a600906a09b3f75b6b

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/test/java/hudson/plugins/git/opt/PreBuildMergeOptionsTest.java
          http://jenkins-ci.org/commit/git-plugin/2ca619d576e3d40c194eae84a986c37c1986dcae
          Log:
          JENKINS-9843 Forgot to record what problem this was fixing.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/test/java/hudson/plugins/git/opt/PreBuildMergeOptionsTest.java http://jenkins-ci.org/commit/git-plugin/2ca619d576e3d40c194eae84a986c37c1986dcae Log: JENKINS-9843 Forgot to record what problem this was fixing.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/java/hudson/plugins/git/opt/PreBuildMergeOptions.java
          src/test/java/hudson/plugins/git/opt/PreBuildMergeOptionsTest.java
          http://jenkins-ci.org/commit/git-plugin/e7f355b86284296654f96ba3c47617308fa4f37a
          Log:
          [FIXED JENKINS-9843] PreBuildMergeOptions.getMergeRemote() cannot be @Exported, since the return type is not @ExportedBean.
          Corrects attempted fix b3ddce6.
          (cherry picked from commit ec813101f6667a34b75775a600906a09b3f75b6b)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/hudson/plugins/git/opt/PreBuildMergeOptions.java src/test/java/hudson/plugins/git/opt/PreBuildMergeOptionsTest.java http://jenkins-ci.org/commit/git-plugin/e7f355b86284296654f96ba3c47617308fa4f37a Log: [FIXED JENKINS-9843] PreBuildMergeOptions.getMergeRemote() cannot be @Exported, since the return type is not @ExportedBean. Corrects attempted fix b3ddce6. (cherry picked from commit ec813101f6667a34b75775a600906a09b3f75b6b)

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/test/java/hudson/plugins/git/opt/PreBuildMergeOptionsTest.java
          http://jenkins-ci.org/commit/git-plugin/64b8ae689fc02ba222b56a7ae9c614d8da8cf76e
          Log:
          JENKINS-9843 Forgot to record what problem this was fixing.
          (cherry picked from commit 2ca619d576e3d40c194eae84a986c37c1986dcae)

          Compare: https://github.com/jenkinsci/git-plugin/compare/529fcbcfaaea^...64b8ae689fc0

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/test/java/hudson/plugins/git/opt/PreBuildMergeOptionsTest.java http://jenkins-ci.org/commit/git-plugin/64b8ae689fc02ba222b56a7ae9c614d8da8cf76e Log: JENKINS-9843 Forgot to record what problem this was fixing. (cherry picked from commit 2ca619d576e3d40c194eae84a986c37c1986dcae) Compare: https://github.com/jenkinsci/git-plugin/compare/529fcbcfaaea ^...64b8ae689fc0

            jglick Jesse Glick
            gvalkov Georgi Valkov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: