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

m2release build fails with java.lang.ClassCastException: net.sf.json.JSONNull cannot be cast to net.sf.json.JSONObject

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Blocker Blocker
    • m2release-plugin
    • None
    • Linux RHEL5 on virtual VMWare managed system

      When trying to release a Maven component or application (via the Perform Maven Release link), the following error is generated:

      Status Code: 500

      Exception: java.lang.ClassCastException: net.sf.json.JSONNull cannot be cast to net.sf.json.JSONObject
      Stacktrace:
      javax.servlet.ServletException: java.lang.ClassCastException: net.sf.json.JSONNull cannot be cast to net.sf.json.JSONObject
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:719)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770)
      at org.kohsuke.stapler.MetaClass$12.dispatch(MetaClass.java:384)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:677)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770)
      at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:241)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:677)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770)
      at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:241)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:677)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:583)
      at org.kohsuke.stapler.Stapler.service(Stapler.java:214)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:95)
      at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:206)
      at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:179)
      at net.bull.javamelody.PluginMonitoringFilter.doFilter(PluginMonitoringFilter.java:86)
      at org.jvnet.hudson.plugins.monitoring.HudsonMonitoringFilter.doFilter(HudsonMonitoringFilter.java:84)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:98)
      at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:87)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:48)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
      at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:174)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at jenkins.security.ApiTokenFilter.doFilter(ApiTokenFilter.java:64)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
      at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
      at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:50)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
      at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1824)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:662)
      Caused by: java.lang.ClassCastException: net.sf.json.JSONNull cannot be cast to net.sf.json.JSONObject
      at org.jvnet.hudson.plugins.m2release.M2ReleaseAction.doSubmit(M2ReleaseAction.java:239)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:288)
      at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:151)
      at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:90)
      at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:111)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:677)
      ... 71 more

      This problem was introduced in the 1.506 release. After rolling back to the 1.505 release, the problem goes away.

          [JENKINS-17264] m2release build fails with java.lang.ClassCastException: net.sf.json.JSONNull cannot be cast to net.sf.json.JSONObject

          vinz r added a comment -

          I still encountered this error on 1.507.

          Thanks,

          Vinz

          vinz r added a comment - I still encountered this error on 1.507. Thanks, Vinz

          Pim Do added a comment -

          I encounter it in 1.508 and 1.509 as well
          What is the issue here?

          Pim Do added a comment - I encounter it in 1.508 and 1.509 as well What is the issue here?

          Duplicate of JENKINS-13465. Fix for that has just been integrated (not released yet though).

          Richard Mortimer added a comment - Duplicate of JENKINS-13465 . Fix for that has just been integrated (not released yet though).

          puce added a comment -

          I still encountered this error on 1.510.

          Is there a work-around?

          puce added a comment - I still encountered this error on 1.510. Is there a work-around?

          puce added a comment -

          OK, specifying an arbitrary paramter like
          boolean: workaround=true
          did the trick. (work-around)

          puce added a comment - OK, specifying an arbitrary paramter like boolean: workaround=true did the trick. (work-around)

          The revised m2release-plugin has not been released yet. You can download a pre-release build of it from the link in the plugin page down at the release notes section
          https://wiki.jenkins-ci.org/display/JENKINS/M2+Release+Plugin

          Specifically you need the .hpi file from
          https://jenkins.ci.cloudbees.com/job/plugins/job/m2release-plugin/lastStableBuild/org.jvnet.hudson.plugins.m2release$m2release/

          Upload that .hpi from your jenkins plugin management centre and restart jenkins.

          Richard Mortimer added a comment - The revised m2release-plugin has not been released yet. You can download a pre-release build of it from the link in the plugin page down at the release notes section https://wiki.jenkins-ci.org/display/JENKINS/M2+Release+Plugin Specifically you need the .hpi file from https://jenkins.ci.cloudbees.com/job/plugins/job/m2release-plugin/lastStableBuild/org.jvnet.hudson.plugins.m2release$m2release/ Upload that .hpi from your jenkins plugin management centre and restart jenkins.

          Maciej Matys added a comment - - edited

          Should I see 0.10.0-SNAPSHOT as plugin version number?
          After uploading .hpi and jenkins (ver. 1.511) restart I still have 0.9.1

          Maciej Matys added a comment - - edited Should I see 0.10.0-SNAPSHOT as plugin version number? After uploading .hpi and jenkins (ver. 1.511) restart I still have 0.9.1

          I have just downloaded m2release-0.10.0-SNAPSHOT.hpi from the previously mentioned jenkins.ci.cloudbees.com URL

          The URL download page tells me that it is
          "Build Jenkins Maven Release Plug-in Plug-in (Apr 9, 2013 5:50:15 AM)"

          After uploading the .hpi and restarting Jenkins I am now running m2release

          0.10.0-SNAPSHOT (private-04/09/2013 05:57-jenkins)

          It looks like one of your steps went wrong.

          Richard Mortimer added a comment - I have just downloaded m2release-0.10.0-SNAPSHOT.hpi from the previously mentioned jenkins.ci.cloudbees.com URL The URL download page tells me that it is "Build Jenkins Maven Release Plug-in Plug-in (Apr 9, 2013 5:50:15 AM)" After uploading the .hpi and restarting Jenkins I am now running m2release 0.10.0-SNAPSHOT (private-04/09/2013 05:57-jenkins) It looks like one of your steps went wrong.

          Maciej Matys added a comment -

          One more step uninstall the 0.9.1 thx

          Maciej Matys added a comment - One more step uninstall the 0.9.1 thx

          This bug was fixed in v0.10.0 of the M2 Release Plugin. As such, updating to that plugin version (or newer) should fix this issue.

          From "https://wiki.jenkins-ci.org/display/JENKINS/M2+Release+Plugin":

          Version History
          ...
          0.10.0 (26th Apr 2013)
          ...
          Fix issue #13465 Unable perform release: ClassCastException: net.sf.json.JSONNull cannot be cast to net.sf.json.JSONObject.

          Gordon Daugherty added a comment - This bug was fixed in v0.10.0 of the M2 Release Plugin. As such, updating to that plugin version (or newer) should fix this issue. From "https://wiki.jenkins-ci.org/display/JENKINS/M2+Release+Plugin": Version History ... 0.10.0 (26th Apr 2013) ... Fix issue #13465 Unable perform release: ClassCastException: net.sf.json.JSONNull cannot be cast to net.sf.json.JSONObject.

            Unassigned Unassigned
            spots107 Jason Spotswood
            Votes:
            22 Vote for this issue
            Watchers:
            27 Start watching this issue

              Created:
              Updated:
              Resolved: