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

JEP-200 Global Pipeline Libraries can't filter class

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I have maintained a Global Pipeline Library code that uses the "hudson. plugins. my. devops. action. ShareIndexAction" custom class to store some index data that can be read from different job builds. How do I solve the JEP-200 problem when the following error occurs?

      class source:

      #!/usr/bin/groovy
      package hudson.plugins.my.devops.action
      import org.apache.commons.lang.StringUtils
      import hudson.model.Actionclass ShareIndexAction implements Serializable,Action {
          String shareUuid;
          Integer shareIndex;    
          
          ShareIndexAction() {
              this.shareUuid = null;
              this.shareIndex = null;
          }   
      
          ShareIndexAction(def _uuid, def _index=null) {
              this.shareUuid = _uuid;
              this.shareIndex = _index;
          }    
      
          /* interface */
          @NonCPS
          public String getIconFileName() {
              return null
          }    
      
          public String getDisplayName() {
              return "#${this.shareIndex} - ${this.shareUuid}"
          }   
      
          @NonCPS
          public String getUrlName() {
              return null
          }
      }
      

      I use this class in vars/mycode.groovy,when upgrade to jenkins 2.121.2 is has JEP-200 issue。

      job log output:

      java.lang.UnsupportedOperationException: Refusing to marshal hudson.plugins.my.devops.action.ShareIndexAction for security reasons; see https://jenkins.io/redirect/class-filter/
      

        Attachments

          Activity

          galphy gao fei created issue -
          galphy gao fei made changes -
          Field Original Value New Value
          Description I have maintained a Global Pipeline Library code that uses the "hudson. plugins. my. devops. action. ShareIndexAction" custom class to store some index data. How do I solve the JEP-200 problem when the following error occurs?

          class source:
          {code:java}
          #!/usr/bin/groovy
          package hudson.plugins.my.devops.action
          import org.apache.commons.lang.StringUtils
          import hudson.model.Actionclass ShareIndexAction implements Serializable,Action {
              String shareUuid;
              Integer shareIndex;
              
              ShareIndexAction() {
                  this.shareUuid = null;
                  this.shareIndex = null;
              }

              ShareIndexAction(def _uuid, def _index=null) {
                  this.shareUuid = _uuid;
                  this.shareIndex = _index;
              }

              /* interface */
              @NonCPS
              public String getIconFileName() {
                  return null
              }

              public String getDisplayName() {
                  return "#${this.shareIndex} - ${this.shareUuid}"
              }

              @NonCPS
              public String getUrlName() {
                  return null
              }
          }
          {code}
          I use this class in var/mycode.groovy,when upgrade to jenkins 2.121.2 is has JEP-200 issue。

          job log output:
          java.lang.UnsupportedOperationException: Refusing to marshal hudson.plugins.my.devops.action.ShareIndexAction for security reasons; see https://jenkins.io/redirect/class-filter/
          I have maintained a Global Pipeline Library code that uses the "hudson. plugins. my. devops. action. ShareIndexAction" custom class to store some index data. How do I solve the JEP-200 problem when the following error occurs?

          class source:
          {code:java}
          #!/usr/bin/groovy
          package hudson.plugins.my.devops.action
          import org.apache.commons.lang.StringUtils
          import hudson.model.Actionclass ShareIndexAction implements Serializable,Action {
              String shareUuid;
              Integer shareIndex;
              
              ShareIndexAction() {
                  this.shareUuid = null;
                  this.shareIndex = null;
              }

              ShareIndexAction(def _uuid, def _index=null) {
                  this.shareUuid = _uuid;
                  this.shareIndex = _index;
              }

              /* interface */
              @NonCPS
              public String getIconFileName() {
                  return null
              }

              public String getDisplayName() {
                  return "#${this.shareIndex} - ${this.shareUuid}"
              }

              @NonCPS
              public String getUrlName() {
                  return null
              }
          }
          {code}
          I use this class in var/mycode.groovy,when upgrade to jenkins 2.121.2 is has JEP-200 issue。

          job log output:
          {code:java}
          java.lang.UnsupportedOperationException: Refusing to marshal hudson.plugins.my.devops.action.ShareIndexAction for security reasons; see https://jenkins.io/redirect/class-filter/
          {code}
          galphy gao fei made changes -
          Description I have maintained a Global Pipeline Library code that uses the "hudson. plugins. my. devops. action. ShareIndexAction" custom class to store some index data. How do I solve the JEP-200 problem when the following error occurs?

          class source:
          {code:java}
          #!/usr/bin/groovy
          package hudson.plugins.my.devops.action
          import org.apache.commons.lang.StringUtils
          import hudson.model.Actionclass ShareIndexAction implements Serializable,Action {
              String shareUuid;
              Integer shareIndex;
              
              ShareIndexAction() {
                  this.shareUuid = null;
                  this.shareIndex = null;
              }

              ShareIndexAction(def _uuid, def _index=null) {
                  this.shareUuid = _uuid;
                  this.shareIndex = _index;
              }

              /* interface */
              @NonCPS
              public String getIconFileName() {
                  return null
              }

              public String getDisplayName() {
                  return "#${this.shareIndex} - ${this.shareUuid}"
              }

              @NonCPS
              public String getUrlName() {
                  return null
              }
          }
          {code}
          I use this class in var/mycode.groovy,when upgrade to jenkins 2.121.2 is has JEP-200 issue。

          job log output:
          {code:java}
          java.lang.UnsupportedOperationException: Refusing to marshal hudson.plugins.my.devops.action.ShareIndexAction for security reasons; see https://jenkins.io/redirect/class-filter/
          {code}
          I have maintained a Global Pipeline Library code that uses the "hudson. plugins. my. devops. action. ShareIndexAction" custom class to store some index data that can be read from different job builds. How do I solve the JEP-200 problem when the following error occurs?

          class source:
          {code:java}
          #!/usr/bin/groovy
          package hudson.plugins.my.devops.action
          import org.apache.commons.lang.StringUtils
          import hudson.model.Actionclass ShareIndexAction implements Serializable,Action {
              String shareUuid;
              Integer shareIndex;
              
              ShareIndexAction() {
                  this.shareUuid = null;
                  this.shareIndex = null;
              }

              ShareIndexAction(def _uuid, def _index=null) {
                  this.shareUuid = _uuid;
                  this.shareIndex = _index;
              }

              /* interface */
              @NonCPS
              public String getIconFileName() {
                  return null
              }

              public String getDisplayName() {
                  return "#${this.shareIndex} - ${this.shareUuid}"
              }

              @NonCPS
              public String getUrlName() {
                  return null
              }
          }
          {code}
          I use this class in var/mycode.groovy,when upgrade to jenkins 2.121.2 is has JEP-200 issue。

          job log output:
          {code:java}
          java.lang.UnsupportedOperationException: Refusing to marshal hudson.plugins.my.devops.action.ShareIndexAction for security reasons; see https://jenkins.io/redirect/class-filter/
          {code}
          galphy gao fei made changes -
          Description I have maintained a Global Pipeline Library code that uses the "hudson. plugins. my. devops. action. ShareIndexAction" custom class to store some index data that can be read from different job builds. How do I solve the JEP-200 problem when the following error occurs?

          class source:
          {code:java}
          #!/usr/bin/groovy
          package hudson.plugins.my.devops.action
          import org.apache.commons.lang.StringUtils
          import hudson.model.Actionclass ShareIndexAction implements Serializable,Action {
              String shareUuid;
              Integer shareIndex;
              
              ShareIndexAction() {
                  this.shareUuid = null;
                  this.shareIndex = null;
              }

              ShareIndexAction(def _uuid, def _index=null) {
                  this.shareUuid = _uuid;
                  this.shareIndex = _index;
              }

              /* interface */
              @NonCPS
              public String getIconFileName() {
                  return null
              }

              public String getDisplayName() {
                  return "#${this.shareIndex} - ${this.shareUuid}"
              }

              @NonCPS
              public String getUrlName() {
                  return null
              }
          }
          {code}
          I use this class in var/mycode.groovy,when upgrade to jenkins 2.121.2 is has JEP-200 issue。

          job log output:
          {code:java}
          java.lang.UnsupportedOperationException: Refusing to marshal hudson.plugins.my.devops.action.ShareIndexAction for security reasons; see https://jenkins.io/redirect/class-filter/
          {code}
          I have maintained a Global Pipeline Library code that uses the "hudson. plugins. my. devops. action. ShareIndexAction" custom class to store some index data that can be read from different job builds. How do I solve the JEP-200 problem when the following error occurs?

          class source:
          {code:java}
          #!/usr/bin/groovy
          package hudson.plugins.my.devops.action
          import org.apache.commons.lang.StringUtils
          import hudson.model.Actionclass ShareIndexAction implements Serializable,Action {
              String shareUuid;
              Integer shareIndex;
              
              ShareIndexAction() {
                  this.shareUuid = null;
                  this.shareIndex = null;
              }

              ShareIndexAction(def _uuid, def _index=null) {
                  this.shareUuid = _uuid;
                  this.shareIndex = _index;
              }

              /* interface */
              @NonCPS
              public String getIconFileName() {
                  return null
              }

              public String getDisplayName() {
                  return "#${this.shareIndex} - ${this.shareUuid}"
              }

              @NonCPS
              public String getUrlName() {
                  return null
              }
          }
          {code}
          I use this class in vars/mycode.groovy,when upgrade to jenkins 2.121.2 is has JEP-200 issue。

          job log output:
          {code:java}
          java.lang.UnsupportedOperationException: Refusing to marshal hudson.plugins.my.devops.action.ShareIndexAction for security reasons; see https://jenkins.io/redirect/class-filter/
          {code}
          galphy gao fei made changes -
          Resolution Won't Do [ 10001 ]
          Status Open [ 1 ] Closed [ 6 ]

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            galphy gao fei
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: