• Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • groovy-plugin
    • None
    • All

      DescriptorImpl.newInstance() is deprecated since a while and @DataBoundConstructor should be used instead.

      Builders not having a @DataBoundConstructor can't be used within Extensions (e.g. BuildWrappers) a using @DataBoundConstructor itself.
      Please add a @DataBoundConstructor to

      • hudson.plugins.groovy.Groovy
        and
      • hudson.plugins.groovy.ScriptSource

      Caused by: java.lang.IllegalArgumentException: Failed to instantiate class hudson.plugins.groovy.Groovy from {"groovyName":"(Default)","kind":"hudson.plugins.groovy.Groovy$DescriptorImpl","parameters":"","properties":"","scriptParameters":"","scriptSource":

      {"scriptFile":"dummy.groovy","value":"0"}

      ,"stapler-class":"hudson.plugins.groovy.Groovy"}
      at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:352)
      at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:552)
      at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:587)
      at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:344)
      ... 40 more
      Caused by: org.kohsuke.stapler.NoStaplerConstructorException: There's no @DataBoundConstructor on any constructor of class hudson.plugins.groovy.Groovy
      at org.kohsuke.stapler.RequestImpl.loadConstructorParamNames(RequestImpl.java:461)
      at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:331)

      Caused by: java.lang.IllegalArgumentException: Failed to convert the scriptSource parameter of the constructor public hudson.plugins.groovy.SystemGroovy(hudson.plugins.groovy.ScriptSource,java.lang.String,java.lang.String)
      at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:346)
      ... 43 more
      Caused by: java.lang.IllegalArgumentException: Failed to instantiate interface hudson.plugins.groovy.ScriptSource from

      {"command":"println(\"hello\")","value":"1"}

      at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:352)
      at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:552)
      at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:344)
      ... 43 more
      Caused by: org.kohsuke.stapler.NoStaplerConstructorException: There's no @DataBoundConstructor on any constructor of interface hudson.plugins.groovy.ScriptSource
      at org.kohsuke.stapler.RequestImpl.loadConstructorParamNames(RequestImpl.java:461)
      at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:331)

      The same already had to be done for 'hudson.tasks.Shell' in the core - see http://hudson.361315.n4.nabble.com/DataBoundConstructor-td2244199.html

          [JENKINS-6797] Add @DataBoundConstructor

          Dominik Bartholdi created issue -
          dvrzalik made changes -
          Assignee Original: dvrzalik [ dvrzalik ] New: vjuranek [ vjuranek ]
          cjo9900 made changes -
          Link New: This issue is duplicated by JENKINS-10977 [ JENKINS-10977 ]
          Dominik Bartholdi made changes -
          Link New: This issue is blocking JENKINS-15833 [ JENKINS-15833 ]
          Dominik Bartholdi made changes -
          Link New: This issue is related to JENKINS-15445 [ JENKINS-15445 ]
          vjuranek made changes -
          Assignee Original: vjuranek [ vjuranek ] New: Lucie Votypkova [ lvotypkova ]
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          Dominik Bartholdi made changes -
          Link New: This issue is duplicated by JENKINS-23719 [ JENKINS-23719 ]
          Dominik Bartholdi made changes -
          Link New: This issue is duplicated by JENKINS-15833 [ JENKINS-15833 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 136892 ] New: JNJira + In-Review [ 187308 ]

            lvotypkova Lucie Votypkova
            domi Dominik Bartholdi
            Votes:
            7 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: