Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-3001

BUG! exception in phase 'semantic analysis' in source unit 'sample/SimpleBean.groovy' null using Groovy-1.5.{5,6} with GlassFish V3's JSF+Groovy Support

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.5.5, 1.5.6, 1.6-beta-1
    • 1.5.7, 1.6-beta-2
    • parser
    • None
    • Sun JDK 1.5.0_15
      Unbuntu 8.0.4
      Local build of GlassFish V3
      Mojarra JSF 1.2_09

    Description

      I've begun testing the Groovy support in GlassFish V3 to ensure it still works (it works fine in V2).

      I've copied the groovy-all jar to V3 modules directory which exposes Groovy as an OSGi bundle to the runtime.

      When accessing a page that references a simple Groovy-based managed bean I get the following:

      BUG! exception in phase 'semantic analysis' in source unit 'sample/SimpleBean.groovy' null
      at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:776)
      at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:438)
      at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:277)
      at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:248)
      at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:243)
      at groovy.util.GroovyScriptEngine.updateCacheEntry(GroovyScriptEngine.java:316)
      at groovy.util.GroovyScriptEngine.loadScriptByName(GroovyScriptEngine.java:265)
      at com.sun.faces.scripting.GroovyHelperImpl$MojarraGroovyClassLoader.loadClass(GroovyHelperImpl.java:139)
      at com.sun.faces.util.Util.loadClass(Util.java:223)

      ROOT CAUSE:
      Caused by: java.lang.NullPointerException
      at groovy.util.GroovyScriptEngine$ScriptCacheEntry.access$300(GroovyScriptEngine.java:75)
      at groovy.util.GroovyScriptEngine$1$1.findClass(GroovyScriptEngine.java:101)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:633)
      at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:491)
      at org.codehaus.groovy.control.ResolveVisitor.resolveToClass(ResolveVisitor.java:605)
      at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:251)
      at org.codehaus.groovy.control.ResolveVisitor.resolveFromModule(ResolveVisitor.java:549)
      at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:251)
      at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:219)
      at org.codehaus.groovy.control.ResolveVisitor.resolveOrFail(ResolveVisitor.java:203)
      at org.codehaus.groovy.control.ResolveVisitor.resolveOrFail(ResolveVisitor.java:215)
      at org.codehaus.groovy.control.ResolveVisitor.visitField(ResolveVisitor.java:174)
      at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:812)
      at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:48)
      at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1000)
      at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:141)
      at org.codehaus.groovy.control.CompilationUnit$5.call(CompilationUnit.java:527)
      at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:772)

      Our usage of Groovy is pretty straight forward. We have a simple ClassLoader that wraps the GroovyScriptEngine [1].

      The Groovy-based bean is simple:
      --------------------------------------------------
      package sample;

      public class SimpleBean {

      private String message = "Hello World!";

      public String getMessage()

      { return message; }

      }
      --------------------------------------------------

      [1] http://fisheye5.cenqua.com/browse/javaserverfaces-sources/jsf-ri/src/com/sun/faces/scripting/GroovyHelperImpl.java?r=1.1.2.4

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            rlubke Ryan Lubke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: