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

NPE thrown when scheduling a new Maven release

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Duplicate
    • Component/s: m2release-plugin
    • Labels:
      None
    • Environment:
      m2release-plugin 0.14
    • Similar Issues:

      Description

      After upgrading to Jenkins 1.580.3 (fails with 1.608 too), scheduling a new release by clicking "Perform Maven Release" then "Schedule Maven Release build" is failing. It opens an error page with this NPE:

      javax.servlet.ServletException: java.lang.NullPointerException
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:796)
              ...
      Caused by: java.lang.NullPointerException
      	at org.jvnet.hudson.plugins.m2release.M2ReleaseAction.getString(M2ReleaseAction.java:318)
      	at org.jvnet.hudson.plugins.m2release.M2ReleaseAction.doSubmit(M2ReleaseAction.java:223)

      Seems that StaplerRequest.getParameterMap() behavior changed, as httpParam map is empty instead of containing HTTP request parameters. Method M2ReleaseAction.getString() is not protected again this and causes the NPE.

        Attachments

          Issue Links

            Activity

            Hide
            teilo James Nord added a comment -

            No point protecting against this, if we can't get the http parameters all bets are off.
            Nets to be fixed in core/stapler

            Show
            teilo James Nord added a comment - No point protecting against this, if we can't get the http parameters all bets are off. Nets to be fixed in core/stapler
            Hide
            ydubreuil Yoann Dubreuil added a comment -

            Agreed. I was just explaining why NPE was thrown. I'm not sure the problem is in core. POST request is sending multi-part content, which was probably not the case before. getParameterMap() doesn't work in that case.

            I don't understand why getSubmittedForm() is not used here. This comment at line 205 is not clear to me:

            // JSON collapses everything in the dynamic specifyVersions section so
            // we need to fall back to
            // good old http...
            

            If you can shed some light...

            Show
            ydubreuil Yoann Dubreuil added a comment - Agreed. I was just explaining why NPE was thrown. I'm not sure the problem is in core. POST request is sending multi-part content, which was probably not the case before. getParameterMap() doesn't work in that case. I don't understand why getSubmittedForm() is not used here. This comment at line 205 is not clear to me: // JSON collapses everything in the dynamic specifyVersions section so // we need to fall back to // good old http... If you can shed some light...
            Hide
            teilo James Nord added a comment -
            Show
            teilo James Nord added a comment - JENKINS-16043

              People

              • Assignee:
                teilo James Nord
                Reporter:
                ydubreuil Yoann Dubreuil
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: