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

Global AST transformation breaks compilation

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • xforms
    • None

    Description

      I'm trying to build a project with a groovy 2.2.1. I have grails-core-1.2.0.jar in the project which contains a global AST transformation org.codehaus.groovy.grails.compiler.injection.GlobalPluginAwareEntityASTTransformation which seems to throw the following exception during compilation.

      It would be nice to be able to skip particular transformations or transformations throwing exceptions.

      Groovyc: java.lang.NoClassDefFoundError: org/codehaus/groovy/grails/commons/spring/RuntimeSpringConfiguration
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at java.lang.Class.privateGetDeclaredMethods(Class.java:2521)
      at java.lang.Class.privateGetPublicMethods(Class.java:2641)
      at java.lang.Class.getMethods(Class.java:1457)
      at org.codehaus.groovy.reflection.stdclasses.CachedSAMClass.getSAMMethod(CachedSAMClass.java:135)
      at org.codehaus.groovy.reflection.ClassInfo.isSAM(ClassInfo.java:280)
      at org.codehaus.groovy.reflection.ClassInfo.createCachedClass(ClassInfo.java:270)
      at org.codehaus.groovy.reflection.ClassInfo.access$400(ClassInfo.java:36)
      at org.codehaus.groovy.reflection.ClassInfo$LazyCachedClassRef.initValue(ClassInfo.java:441)
      at org.codehaus.groovy.reflection.ClassInfo$LazyCachedClassRef.initValue(ClassInfo.java:432)
      at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46)
      at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
      at org.codehaus.groovy.reflection.ClassInfo.getCachedClass(ClassInfo.java:89)
      at org.codehaus.groovy.reflection.ReflectionCache.getCachedClass(ReflectionCache.java:107)
      at org.codehaus.groovy.reflection.ParameterTypes.getParametersTypes0(ParameterTypes.java:78)
      at org.codehaus.groovy.reflection.ParameterTypes.getParameterTypes(ParameterTypes.java:64)
      at groovy.lang.MetaClassImpl.findPropertyMethod(MetaClassImpl.java:1994)
      at groovy.lang.MetaClassImpl.applyStrayPropertyMethods(MetaClassImpl.java:2270)
      at groovy.lang.MetaClassImpl.setupProperties(MetaClassImpl.java:2128)
      at groovy.lang.MetaClassImpl.addProperties(MetaClassImpl.java:3075)
      at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:3046)
      at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:176)
      at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:192)
      at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:255)
      at org.codehaus.groovy.runtime.InvokerHelper.getMetaClass(InvokerHelper.java:859)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallStaticSite(CallSiteArray.java:72)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:159)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
      at org.codehaus.groovy.grails.plugins.GrailsPluginUtils.getPluginBuildSettings(GrailsPluginUtils.groovy:143)
      at org.codehaus.groovy.grails.compiler.injection.GlobalPluginAwareEntityASTTransformation.visit(GlobalPluginAwareEntityASTTransformation.java:58)
      at org.codehaus.groovy.transform.ASTTransformationVisitor$3.call(ASTTransformationVisitor.java:319)
      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.processPhaseOperations(CompilationUnit.java:550)
      at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:527)
      at org.jetbrains.groovy.compiler.rt.GroovyCompilerWrapper.compile(GroovyCompilerWrapper.java:54)
      at org.jetbrains.groovy.compiler.rt.DependentGroovycRunner.runGroovyc(DependentGroovycRunner.java:80)
      at org.jetbrains.groovy.compiler.rt.GroovycRunner.main(GroovycRunner.java:85)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:121)
      Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.grails.commons.spring.RuntimeSpringConfiguration
      at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      ... 45 more

      Attachments

        Activity

          People

            Unassigned Unassigned
            mxm-groovy Maxim Medvedev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: