使用@ I18nFields时方法编译错误的重复方法名称/签名

1 grails internationalization grails-2.3

当我尝试i18nFields在我的域类中使用支持多种语言时,我得到重复的方法名称/签名编译失败.

Grails版本:2.3.7(我尝试使用2.3.4并获得相同的问题并升级)

Grails随后提供的文档是http://grails.org/plugin/i18n-fields

我的Domain类看起来像

package com.sampleapp.domain

import i18nfields.I18nFields;

@I18nFields
class Products {

 def name

 static constraints = {}

 static i18nFields = ['name']
}
Run Code Online (Sandbox Code Playgroud)

Config.groovy有以下行包括指定语言环境

// internationalization support - testing 
i18nFields {
    locales = ['en','es']
}
Run Code Online (Sandbox Code Playgroud)

BuildConfig.groovy插件定义

plugins {
    // plugins for the build system only
    build ":tomcat:7.0.47"

    // plugins for the compile step
    compile ":scaffolding:2.0.1"
    compile ':cache:1.1.1'

    // plugins needed at runtime but not for compilation
    runtime  ":hibernate:3.6.10.6" // or":hibernate4:4.1.11"//
    runtime ":database-migration:1.3.8"
    runtime ":jquery:1.10.2.2"
//  compile  ":jquery-ui:1.10.2.2"
    runtime ":resources:1.2.1"
    // Uncomment these (or add new ones) to enable additional resources capabilities
    runtime ":zipped-resources:1.0.1"
    runtime ":cached-resources:1.1"
    //runtime ":yui-minify-resources:0.1.5"

    compile ':platform-core:1.0.RC6'
    compile ":cache-headers:1.1.5"
    runtime ':spring-security-core:2.0-RC2'
    // internationalization
    compile ":i18n-fields:0.8.1"
}
Run Code Online (Sandbox Code Playgroud)

编译错误是

grails-workspace\Test\grails-app\domain\com\sampleapp\domain\Products.groovy: -1: Repetitive method name/signature for method 'void setName_es(java.lang.String)' in class 'com.sampleapp.domain.Products'.
 @ line -1, column -1.
Run Code Online (Sandbox Code Playgroud)

对en和es语言环境的name属性重复两次Error.

如果我删除i18nFields注释并且示例应用程序在此之前工作正常,则没有错误.我在控制器发布中验证了控制器中类似错误的GGTS重复方法名称/签名错误.我还验证了确保groovy版本是正确的,在我的情况下它是2.1

有人可以给我任何关于我应该在哪里解决这个问题的指示.

小智 9

当您尝试将Java> v7与任何版本的Grails <2.3.7一起使用时,会出现此问题.要么降级你的jvm或升级你的grails.