JsonSlurper does not work after updating to Jenkins 2.x

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      After installing jenkins 2.6 locally to test my pipeline scripts, I am unable to use JsonSlurper due to errors about LazyMap not being serializable.

      java.io.NotSerializableException: groovy.json.internal.LazyMap
      

      That can't be changed so I looked for a workaround and tried passing the LazyMap into the constructor of a new HashMap:

      org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use new java.util.HashMap java.util.Map
      

      So then I found the JsonSlurperClassic class, which should solve the issue by going back to the Groovy 1.x behavior, however then I get:

      org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use new groovy.json.JsonSlurperClassic
      

      None of these errors show up in the script approval queue, so I can't whitelist them myself. Please add new JsonSlurperClassic and/or new HashMap to the default whitelist. This will block my upgrade to 2.x otherwise.

            Assignee:
            Andrew Bayer
            Reporter:
            Jacob Fike
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: