Spring Tool Suite
  1. Spring Tool Suite
  2. STS-3362

i18n-fields grails plugin not compatible with GGTS

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2.0.RELEASE
    • Fix Version/s: 3.3.0.M2
    • Component/s: GRAILS
    • Labels:
      None

      Description

      Originally discussed here: http://forum.springsource.org/showthread.php?136906-Strange-Java-Problem-GGTS-3-2&p=444653

      The i18n-fields plugin does not work well in GGTS.

      1. create an empty grails project using grails 2.2.1
      2. install-plugin i18n-fields
      3. create a groovy class like this:
      package other
      @i18nfields.I18nFields
      class Content { }
      

      The compiler throws an exception like this:

      General error during canonicalization: /Users/andrew/Eclipse/Installations/Eclipse4.2.1.64/Eclipse.app/Contents/MacOS/
       grails-app/conf/Config.groovy (No such file or directory) java.io.FileNotFoundException: /Users/andrew/Eclipse/
       Installations/Eclipse4.2.1.64/Eclipse.app/Contents/MacOS/grails-app/conf/Config.groovy (No such file or directory) at 
       java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:138) at 
       java.io.FileInputStream.<init>(FileInputStream.java:97) at 
       sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90) at 
       sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188) at 
       org.codehaus.groovy.runtime.ResourceGroovyMethods.configuredInputStream(ResourceGroovyMethods.java:1855) at 
       org.codehaus.groovy.runtime.ResourceGroovyMethods.newReader(ResourceGroovyMethods.java:1923) at 
       org.codehaus.groovy.runtime.ResourceGroovyMethods.getText(ResourceGroovyMethods.java:612) at 
       org.codehaus.groovy.runtime.ResourceGroovyMethods.getText(ResourceGroovyMethods.java:584) at 
       org.codehaus.groovy.runtime.dgm$785.doMethodInvoke(Unknown Source) at 
       org.codehaus.groovy.reflection.GeneratedMetaMethod$Proxy.doMethodInvoke(GeneratedMetaMethod.java:70) at 
       groovy.lang.MetaClassImpl$GetBeanMethodMetaProperty.getProperty(MetaClassImpl.java:3493) at 
       org.codehaus.groovy.runtime.callsite.GetEffectivePojoPropertySite.getProperty(GetEffectivePojoPropertySite.java:61) at 
       org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:227) at 
       groovy.util.ConfigSlurper.parse(ConfigSlurper.groovy:147) at groovy.util.ConfigSlurper$parse.call(Unknown Source) at 
       i18nfields.ConfigProvider.getConfig(ConfigProvider.groovy:9) at i18nfields.ConfigProvider$getConfig.call(Unknown Source) 
       at i18nfields.I18nFieldsTransformation.getPluginConfig(I18nFieldsTransformation.groovy:55) at 
       i18nfields.I18nFieldsTransformation.this$2$getPluginConfig(I18nFieldsTransformation.groovy) 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:601) at 
       org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at 
       groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) at groovy.lang.MetaClassImpl
       $GetBeanMethodMetaProperty.getProperty(MetaClassImpl.java:3493) at 
       org.codehaus.groovy.runtime.callsite.GetEffectivePogoPropertySite.callGroovyObjectGetProperty(GetEffectivePogoPropertySite
       .java:67) at i18nfields.I18nFieldsTransformation.checkForDeprecatedConfiguration(I18nFieldsTransformation.groovy:34) at 
       i18nfields.I18nFieldsTransformation.visit(I18nFieldsTransformation.groovy:23) at 
       org.codehaus.groovy.transform.ASTTransformationVisitor.visitClass(ASTTransformationVisitor.java:166) at 
       org.codehaus.groovy.transform.ASTTransformationVisitor$2.call(ASTTransformationVisitor.java:239) at 
       org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1213) at 
       org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:645) at 
       org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:623) at 
       org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:600) at 
       org.codehaus.jdt.groovy.internal.compiler.ast.GroovyCompilationUnitDeclaration.processToPhase(GroovyCompilationUnitDec
       laration.java:173) at 
       org.codehaus.jdt.groovy.internal.compiler.ast.GroovyCompilationUnitDeclaration.analyseCode(GroovyCompilationUnitDeclara
       tion.java:2100) at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:833) at 
       org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:137) at 
       java.lang.Thread.run(Thread.java:722)
      

      The i18nfields.ConfigProvider class hard codes its config location to be System.properties['user.dir']. When run on the command line, user.dir would be the grails project, but when run in Eclipse, user.dir is where you launched Eclipse from.

        Activity

        Hide
        Andrew Eisenberg (c) added a comment -

        And indeed, when I edit the plugin so that it uses the project directory instead of user.dir, the compile works. This is a problem with the plugin since GGTS cannot update the user.dir for every build. The ast transform is not being well-behaved because it is making too many assumptions about how the compile is going to be called. I will need to look into how it should be changed so that it can work in the IDE.

        Show
        Andrew Eisenberg (c) added a comment - And indeed, when I edit the plugin so that it uses the project directory instead of user.dir, the compile works. This is a problem with the plugin since GGTS cannot update the user.dir for every build. The ast transform is not being well-behaved because it is making too many assumptions about how the compile is going to be called. I will need to look into how it should be changed so that it can work in the IDE.
        Hide
        Andrew Eisenberg (c) added a comment -

        Issue raised on the plugin's jira: http://jira.grails.org/browse/GPI18NFIELDS-9

        Show
        Andrew Eisenberg (c) added a comment - Issue raised on the plugin's jira: http://jira.grails.org/browse/GPI18NFIELDS-9

          People

          • Assignee:
            Andrew Eisenberg (c)
            Reporter:
            Andrew Eisenberg (c)
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: