Issue Details (XML | Word | Printable)

Key: GROOVY-2153
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Jochen Theodorou
Reporter: Olaf Lenzmann
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
groovy

BUG! exception in phase 'semantic analysis'

Created: 28/Sep/07 02:29 PM   Updated: 29/Sep/07 06:15 AM   Resolved: 29/Sep/07 02:59 AM
Component/s: None
Affects Version/s: 1.1-beta-3
Fix Version/s: 1.1-rc-1

Time Tracking:
Not Specified

Environment:
Mac OS 10.4.10, Java 1.5.0_07-87
Running groovy embedded in an app


 Description  « Hide

This happens only on Mac OS & Apple Java, not on Win32 (Sun or JRockit), not on Suse Linux (Sun JDK). We use Groovy embedded into a large J2EE-app, so I cannot provide a meaningful test case (loads of dependencies in the script on the environment classes).

Caused by: BUG! exception in phase 'semantic analysis' in source unit 'com/pvs/pmm/domainmodel/services/XlsImport.groovy' null
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:789)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:448)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:290)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:260)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:255)
at groovy.util.GroovyScriptEngine.updateCacheEntry(GroovyScriptEngine.java:355)
at groovy.util.GroovyScriptEngine.run(GroovyScriptEngine.java:404)
at com.pvs.groovy.GroovyEngine.runScript(GroovyEngine.java:61)



Jochen Theodorou added a comment - 28/Sep/07 06:33 PM

the Exception you have shown has a nested NullPointerException, I need the trace of the nested exception to actually see where the NPE comes from. Please provide this trace or we won't be able to fix the problem


Olaf Lenzmann added a comment - 29/Sep/07 02:24 AM

Missed that - here it is:

Caused by: java.lang.NullPointerException
at groovy.util.GroovyScriptEngine.getResourceConnection(GroovyScriptEngine.java:180)
at groovy.util.GroovyScriptEngine$1$1.findClass(GroovyScriptEngine.java:105)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:618)
at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:480)
at org.codehaus.groovy.control.ResolveVisitor.resolveToClass(ResolveVisitor.java:419)
at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:163)
at org.codehaus.groovy.control.ResolveVisitor.resolveFromDefaultImports(ResolveVisitor.java:284)
at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:163)
at org.codehaus.groovy.control.ResolveVisitor.resolveFromStaticInnerClasses(ResolveVisitor.java:269)
at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:163)
at org.codehaus.groovy.control.ResolveVisitor.resolveFromStaticInnerClasses(ResolveVisitor.java:269)
at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:163)
at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:743)
at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:72)
at org.codehaus.groovy.control.CompilationUnit$5.call(CompilationUnit.java:537)
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:785)


Jochen Theodorou added a comment - 29/Sep/07 02:59 AM

ok, I fixed the NPE. but from the looks of the code I guess that there is another exception that was swallowed by throwing the NPE in the finally block. So I suggest you get the head version of groovy out of the repository and check the new exception... and fill a new issue if Groovy is to blame for it


Olaf Lenzmann added a comment - 29/Sep/07 06:15 AM

That has solved the problem, script runs now as expected. Thanks!