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]

          amit khurdhara created issue -
          amit khurdhara made changes -
          Summary Original: groovy.lang.missinMethodException: no signature of method : xyz() is applicable for argument type (java.lang.String) : values [SUCCESS] New: groovy.lang.missinMethodException: no signature of method : xyz() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl) values[SUCCESS]
          amit khurdhara made changes -
          Summary Original: groovy.lang.missinMethodException: no signature of method : xyz() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl) values[SUCCESS] New: groovy.lang.missinMethodException: no signature of method : java.lang.String. is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl) values[SUCCESS]
          amit khurdhara made changes -
          Summary Original: groovy.lang.missinMethodException: no signature of method : java.lang.String. is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl) values[SUCCESS] New: groovy.lang.missinMethodException: no signature of method : java.lang.String.notifyStatusChangeViaEmail() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl) values[SUCCESS]
          amit khurdhara made changes -
          Priority Original: Minor [ 4 ] New: Critical [ 2 ]
          amit khurdhara made changes -
          Description Original:  

          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 

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

           

          *and method signature is like* 

           

          public class MyClass {public class MyClass {

                                          def notifyStatusChangeViaEmail(GString buildStatus) {

                                          // TODO

          }

          }

           
          New:  

          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 }

          }

           
          amit khurdhara made changes -
          Description Original:  

          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 }

          }

           
          New:  

          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

                                          }

          }

           

          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.
          Andrew Bayer made changes -
          Component/s New: workflow-cps-plugin [ 21713 ]
          Component/s Original: pipeline [ 21692 ]

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

              Created:
              Updated: