-
Bug
-
Resolution: Won't Fix
-
Minor
-
None
-
Jenkins 2.6, pipeline 2.1, script-security 1.19
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.
- is related to
-
JENKINS-33024 XmlSlurper.parseText() not whitelisted
- Resolved