Forum Discussion

StevenC's avatar
StevenC
Contributor
11 years ago

Compilation errors in external groovy libraries

I just made what should have been a very minor change to an external library and tried to rerun my script and got the following...

Tue Jun 10 20:48:20 EDT 2014:ERROR:An error occurred [No match found], see error log for details
Tue Jun 10 20:48:20 EDT 2014:ERROR:An error occurred [BUG! exception in phase 'semantic analysis' in source unit 'Script6.groovy' The lookup for com.nuance.clu.qaAutomation.cac.CacTest caused a failed compilaton. There should not have been any compilation from this call.], see error log for details



The error log shows

Tue Jun 10 20:48:20 EDT 2014:ERROR:BUG! exception in phase 'semantic analysis' in source unit 'Script6.groovy' The lookup for com.nuance.clu.qaAutomation.cac.CacTest caused a failed compilaton. There should not have been any compilation from this call.
BUG! exception in phase 'semantic analysis' in source unit 'Script6.groovy' The lookup for com.nuance.clu.qaAutomation.cac.CacTest caused a failed compilaton. There should not have been any compilation from this call.
at org.codehaus.groovy.control.ClassNodeResolver.tryAsLoaderClassOrScript(ClassNodeResolver.java:188)
at org.codehaus.groovy.control.ClassNodeResolver.findClassNode(ClassNodeResolver.java:168)
at org.codehaus.groovy.control.ClassNodeResolver.resolveName(ClassNodeResolver.java:124)
at org.codehaus.groovy.control.ResolveVisitor.resolveToOuter(ResolveVisitor.java:616)
at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:268)
at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1140)
at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:141)
at org.codehaus.groovy.control.CompilationUnit$10.call(CompilationUnit.java:632)
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:912)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:574)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:523)
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:279)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:258)
at groovy.lang.GroovyShell.parseClass(GroovyShell.java:613)
at groovy.lang.GroovyShell.parse(GroovyShell.java:625)
at groovy.lang.GroovyShell.parse(GroovyShell.java:652)
at groovy.lang.GroovyShell.parse(GroovyShell.java:643)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.compile(SoapUIGroovyScriptEngine.java:148)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:93)
at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SourceFile:89)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:149)
at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:274)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


My question is not specific to this particular error, I'll figure that out but this type of error is a constant thorn in my side. The error message could not be any less helpful, all I know at this point is there is something causing a compilation failure in the external groovy class, no line number, no mention of what undefined name it can't find nothing whatsoever that I can go on to begin debugging and since I don't have access to another IDE at the moment I am often stuck cutting all of the code out of the class then slowly adding it back in method by method until I find the offending line.

Does anyone know of a way to get more useful information about what the problem is when this happens?
  • Actually no, I was not requesting a new feature, I was asking if anyone knew of a way to get a more information when this happens or a better way to debug the problem. While better error handling would be nice it'll be 3 - 6 months at best (if ever) before you got the feature implemented and by that time the bulk of my heavy framework development will be done and this won't be anywhere near as much of a problem so it really doesn't help me all that much
    • chmelvv's avatar
      chmelvv
      Occasional Contributor

      I my situation problem was that I try to import groovy lib script from

      <soapui>\bin\scripts\  folder

      which includes import of another jar lib which was not exist in

      C:\Program Files\SmartBear\ReadyAPI-1.8.5\lib folder.

      When I put appropriate jar file to that folder - problem disappeared.

      • ShivaniKamboj's avatar
        ShivaniKamboj
        Occasional Contributor

        Hi ,

        I too faced the same issue but got it resolved using online Groovy compliers: https://groovyconsole.appspot.com/

        which suggested me that there is a parenthesis missing.

         

        Hope this helps who so ever face the same challenge.

         

        Regards

        Shivani

  • Also one thing I would like to note, you seem to have some kind of bug with reloading external script libraries when they change. On numerous occasions I have made a change to 1 external goovy class and when running the test to check the change am told there was a compilation error either in that class or some other (potentially completely unrelated) class. After spending time unsuccessfully searching for the problem I go to basics and create a script which just imports the offending class, I cut all methods out of the class, save it, then begin pasting the methods back in 1 by 1 without making any changes and miraculously the compilation error goes away