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

RejectedAccessException thrown but no pending script approval added

    • workflow-cps 2.67

      When using

      new GetMethod(url)

      from

      import org.apache.commons.httpclient.HttpClient
      import org.apache.commons.httpclient.methods.GetMethod

      directly in a Workflow script pasted into the UI, everything works as expected.

      When the script is loaded with the file loader plugin during the Workflow script, the following error occurs:

      org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use new org.apache.commons.httpclient.methods.GetMethod java.lang.String

      No pending script approval is generated.

          [JENKINS-34973] RejectedAccessException thrown but no pending script approval added

          Tobias Larscheid created issue -
          Tobias Larscheid made changes -
          Description Original: When using

          {{new GetMethod(url)}}

          from

          {{import org.apache.commons.httpclient.HttpClient
          import org.apache.commons.httpclient.methods.GetMethod}}

          directly in a Workflow script pasted into the UI, everything works as expected.

          When the script is loaded with the file loader plugin during the Workflow script, the following error occurs:

          {{org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use new org.apache.commons.httpclient.methods.GetMethod java.lang.String}}

          No pending script approval is generated.
          New: When using

          {{new GetMethod(url)}}

          from

          {{import org.apache.commons.httpclient.HttpClient}}
          {{import org.apache.commons.httpclient.methods.GetMethod}}

          directly in a Workflow script pasted into the UI, everything works as expected.

          When the script is loaded with the file loader plugin during the Workflow script, the following error occurs:

          {{org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use new org.apache.commons.httpclient.methods.GetMethod java.lang.String}}

          No pending script approval is generated.
          Jesse Glick made changes -
          Summary Original: Workflow scripts not permitted to use apache http client get method New: RejectedAccessException thrown but no pending script approval added
          Jesse Glick made changes -
          Epic Link New: JENKINS-35391 [ 171184 ]
          Marcus Philip made changes -
          Comment [ I have same problem using groovy.json.JsonSlurper().parse(url).
          How am I supposed to do that? ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 171177 ] New: JNJira + In-Review [ 184209 ]
          Andrew Bayer made changes -
          Component/s New: pipeline-general [ 21692 ]
          Andrew Bayer made changes -
          Component/s Original: workflow-plugin [ 18820 ]
          Jesse Glick made changes -
          Component/s New: workflow-cps-plugin [ 21713 ]
          Component/s Original: pipeline [ 21692 ]
          Jesse Glick made changes -
          Component/s New: script-security-plugin [ 18520 ]
          Jesse Glick made changes -
          Link New: This issue is duplicated by JENKINS-41571 [ JENKINS-41571 ]

            jglick Jesse Glick
            tobilarscheid Tobias Larscheid
            Votes:
            10 Vote for this issue
            Watchers:
            28 Start watching this issue

              Created:
              Updated:
              Resolved: