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

          dogfood added a comment -

          Integrated in plugins_git-plugin #146
          [FIXED JENKINS-9843] PreBuildMergeOptions can now export for the API properly.

          Andrew Bayer : b3ddce61d33dfd4d2ac95dcdfbde5ba63c983f23
          Files :

          • src/main/java/hudson/plugins/git/opt/PreBuildMergeOptions.java

          dogfood added a comment - Integrated in plugins_git-plugin #146 [FIXED JENKINS-9843] PreBuildMergeOptions can now export for the API properly. Andrew Bayer : b3ddce61d33dfd4d2ac95dcdfbde5ba63c983f23 Files : src/main/java/hudson/plugins/git/opt/PreBuildMergeOptions.java

          Georgi Valkov added a comment -

          Kudos for the quick fix!

          I just wanted to mention that the git.hpi from http://ci.jenkins-ci.org/job/plugins_git-plugin/146/ behaves strangely in our environment:

          hudson.util.IOException2: Unable to read /var/hudson/jobs/git-somejob/builds/2011-06-02_08-52-17/build.xml
          at hudson.XmlFile.unmarshal(XmlFile.java:152)
          at hudson.model.Run.reload(Run.java:281)
          at hudson.model.Run.<init>(Run.java:270)
          at hudson.model.AbstractBuild.<init>(AbstractBuild.java:158)
          at hudson.model.Build.<init>(Build.java:100)
          at hudson.model.FreeStyleBuild.<init>(FreeStyleBuild.java:41)
          at sun.reflect.GeneratedConstructorAccessor19.newInstance(Unknown Source)
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
          at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
          at hudson.model.AbstractProject.loadBuild(AbstractProject.java:935)
          at hudson.model.AbstractProject$1.create(AbstractProject.java:253)
          at hudson.model.AbstractProject$1.create(AbstractProject.java:251)
          at hudson.model.RunMap.load(RunMap.java:221)
          at hudson.model.AbstractProject.onLoad(AbstractProject.java:251)
          at hudson.model.Project.onLoad(Project.java:88)
          at hudson.model.Items.load(Items.java:114)
          at hudson.model.Hudson$13.run(Hudson.java:2354)
          ...

          Caused by: com.thoughtworks.xstream.converters.ConversionException: Cannot deserialize object with new readObject()/writeObject() methods
          ---- Debugging information ----
          class : hudson.model.FreeStyleBuild
          required-type : org.eclipse.jgit.lib.ObjectId
          path : /build/actions/hudson.plugins.git.util.BuildData/buildsByBranchName/entry/hudson.plugins.git.util.Build/revision/sha1
          line number : 19

          This might not be related to your fix, but I'm throwing it in just in case. Thanks.

          Georgi Valkov added a comment - Kudos for the quick fix! I just wanted to mention that the git.hpi from http://ci.jenkins-ci.org/job/plugins_git-plugin/146/ behaves strangely in our environment: hudson.util.IOException2: Unable to read /var/hudson/jobs/git-somejob/builds/2011-06-02_08-52-17/build.xml at hudson.XmlFile.unmarshal(XmlFile.java:152) at hudson.model.Run.reload(Run.java:281) at hudson.model.Run.<init>(Run.java:270) at hudson.model.AbstractBuild.<init>(AbstractBuild.java:158) at hudson.model.Build.<init>(Build.java:100) at hudson.model.FreeStyleBuild.<init>(FreeStyleBuild.java:41) at sun.reflect.GeneratedConstructorAccessor19.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at hudson.model.AbstractProject.loadBuild(AbstractProject.java:935) at hudson.model.AbstractProject$1.create(AbstractProject.java:253) at hudson.model.AbstractProject$1.create(AbstractProject.java:251) at hudson.model.RunMap.load(RunMap.java:221) at hudson.model.AbstractProject.onLoad(AbstractProject.java:251) at hudson.model.Project.onLoad(Project.java:88) at hudson.model.Items.load(Items.java:114) at hudson.model.Hudson$13.run(Hudson.java:2354) ... Caused by: com.thoughtworks.xstream.converters.ConversionException: Cannot deserialize object with new readObject()/writeObject() methods ---- Debugging information ---- class : hudson.model.FreeStyleBuild required-type : org.eclipse.jgit.lib.ObjectId path : /build/actions/hudson.plugins.git.util.BuildData/buildsByBranchName/entry/hudson.plugins.git.util.Build/revision/sha1 line number : 19 This might not be related to your fix, but I'm throwing it in just in case. Thanks.

          Andrew Bayer added a comment -

          I'm guessing this is due to the JGit upgrade - I'll see if someone can look into it.

          Andrew Bayer added a comment - I'm guessing this is due to the JGit upgrade - I'll see if someone can look into it.

          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: