title: how to fix groovy.lang.MissingMethodException: No signature of method:
body: <p>I am trying to use this method without a closure </p>
  
  <pre><code>def copyAndReplaceText(source, dest, targetText, replaceText){
      dest.write(source.text.replaceAll(targetText, replaceText))
  }
  
  def source = new File('C:/geretd/resumebak.txt') //Hello World
  def dest = new File('C:/geretd/resume.txt') //blank
  
  copyAndReplaceText(source, dest){
      it.replaceAll('Visa', 'Passport!!!!')
  }
  </code></pre>
  
  <p>but when I run it I get the following error:</p>
  
  <pre><code>groovy.lang.MissingMethodException: No signature of method: ConsoleScript3.copyAndReplaceText() is applicable for argument types: (java.io.File, java.io.File, ConsoleScript3$_run_closure1) values: [C:\geretd\resumebak.txt, C:\geretd\resume.txt, ...]
  Possible solutions: copyAndReplaceText(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object)
  
  at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:55)
  
  at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:78)
  
  at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
  
  at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
  
  at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149)
  </code></pre>
  
  <p>What am I doing wrong?</p>