You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Jochen Theodorou (JIRA)" <ji...@apache.org> on 2016/01/30 10:54:39 UTC

[jira] [Resolved] (GROOVY-7738) BUG! exception in phase 'semantic analysis' in source unit

     [ https://issues.apache.org/jira/browse/GROOVY-7738?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jochen Theodorou resolved GROOVY-7738.
--------------------------------------
    Resolution: Cannot Reproduce
      Assignee: Jochen Theodorou

first what the error means: while resolving classes during the compilation of a script, we did do a class loader based lookup, and this lookup failed with a compilation error, because the class loader did cause a compilation on its own. This is bad, because this has big problems with class duplication and circular reference. So we added a logic, which will do a special class loading, which excludes further automated compilation ... instead the new source is then queued into the current compilation process. 
So this means to me a parent of the classloader used for lookups is also a GroovyClassLoader, set to automatically compile scripts -> bad, wrong setup. And also means no bug in Groovy. If that is due to the setup of your environment as provided by soap UI, then it is a bug in soap UI, not Groovy. if that is due to your own setup, then you can ask for advice, if you can show describe us your setup. But without that information I already gave all the advice I can. But all in all, this is no Groovy bug as far as I can tell

> BUG! exception in phase 'semantic analysis' in source unit
> ----------------------------------------------------------
>
>                 Key: GROOVY-7738
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7738
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.1.7
>            Reporter: harrry
>            Assignee: Jochen Theodorou
>
> we have a project developed in groovy using 1.8.0 using SOAPUI 5.1.2. I migrated the project  from SoapUI 5.1.2 to Ready API 1.2.2 which has groovy groovy-all 2.1.7.jar. Ready API 1.2.2 is no more compatible with groovy 1.8.0.So, I was using groovy -all 2.1.7 jar but when I run my script I was getting the below  error:-
> {noformat}
> Fri Jan 29 10:12:28 EST 2016:ERROR:cannot get error line number!
> Fri Jan 29 10:12:28 EST 2016:ERROR:java.lang.IllegalStateException: No match found
>    java.lang.IllegalStateException: No match found
>    	at java.util.regex.Matcher.group(Unknown Source)
>    	at com.eviware.soapui.support.GroovyUtils.extractErrorLineNumber(GroovyUtils.java:132)
>    	at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:164)
>    	at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:263)
>    	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
>    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>    	at java.lang.Thread.run(Unknown Source)
> Fri Jan 29 10:12:28 EST 2016:ERROR:BUG! exception in phase 'semantic analysis' in source unit 'Script5.groovy' The lookup for dbUtils_TargetApi.TGTQueries caused a failed compilaton. There should not have been any compilation from this call.
>    BUG! exception in phase 'semantic analysis' in source unit 'Script5.groovy' The lookup for dbUtils_TargetApi.TGTQueries 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.resolve(ResolveVisitor.java:236)
>    	at org.codehaus.groovy.control.ResolveVisitor.resolveOrFail(ResolveVisitor.java:220)
>    	at org.codehaus.groovy.control.ResolveVisitor.resolveOrFail(ResolveVisitor.java:232)
>    	at org.codehaus.groovy.control.ResolveVisitor.transformConstructorCallExpression(ResolveVisitor.java:969)
>    	at org.codehaus.groovy.control.ResolveVisitor.transform(ResolveVisitor.java:646)
>    	at org.codehaus.groovy.control.ResolveVisitor.transformDeclarationExpression(ResolveVisitor.java:1010)
>    	at org.codehaus.groovy.control.ResolveVisitor.transform(ResolveVisitor.java:638)
>    	at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitExpressionStatement(ClassCodeExpressionTransformer.java:139)
>    	at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:40)
>    	at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:35)
>    	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:163)
>    	at org.codehaus.groovy.control.ResolveVisitor.visitBlockStatement(ResolveVisitor.java:1240)
>    	at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69)
>    	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:101)
>    	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:112)
>    	at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitConstructorOrMethod(ClassCodeExpressionTransformer.java:50)
>    	at org.codehaus.groovy.control.ResolveVisitor.visitConstructorOrMethod(ResolveVisitor.java:166)
>    	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:123)
>    	at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1055)
>    	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:50)
>    	at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1183)
>    	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:138)
>    	at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:89)
>    	at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SoapUIProGroovyScriptEngineFactory.java:76)
>    	at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:142)
>    	at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:263)
>    	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
>    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>    	at java.lang.Thread.run(Unknown Source)
> {noformat}
> my script is used to read the external groovy class which contains db classes and methods.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)