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

groovy.lang.missinMethodException: no signature of method : java.lang.String.notifyStatusChangeViaEmail() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl) values[SUCCESS]

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Critical Critical
    • workflow-cps-plugin
    • None

       

      Getting error like :

      groovy.lang.missinMethodException: no signature of method : xyz() is applicable for argument type (java.lang.String) : values [SUCCESS] 

      my method calling is like :

      pipeline {pipeline {
          *environment

      { def externalMethod = load("D:\\Programs\\Jenkins* *LocalScriptClass.groovy");      }

      *

      ....

      ....

         externalMethod.notifyStatusChangeViaEmail("${currentBuild.currentResult}")

      and method signature in local file is like :

       

      public class MyClass {public class MyClass {

                                      def notifyStatusChangeViaEmail(GString buildStatus)

                                     

      {                                              // TODO                                 }

      }

       

          [JENKINS-52714] groovy.lang.missinMethodException: no signature of method : java.lang.String.notifyStatusChangeViaEmail() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl) values[SUCCESS]

          Andrew Bayer added a comment -

          Please attach your Jenkinsfile.

          Andrew Bayer added a comment - Please attach your Jenkinsfile.

          Andrew Bayer added a comment -

          Oh, and load doesn't actually work the way it seems you think it does. It evaluates the file, but in this case, the return value of the file isn't an instance of your class. You'd need to do something like add return new MyClass() at the end of the file, after the class declaration, though I'm still not 100% sure that'll work either.

          Andrew Bayer added a comment - Oh, and load doesn't actually work the way it seems you think it does. It evaluates the file, but in this case, the return value of the file isn't an instance of your class. You'd need to do something like add return new MyClass() at the end of the file, after the class declaration, though I'm still not 100% sure that'll work either.

            Unassigned Unassigned
            akhurdhara amit khurdhara
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: