我通过执行以下操作将我的 Grails 1.3.7 应用程序升级到 Grails 2.2
- 将
GRAILS_HOME
变量设置为 Grails 2.2 的位置 - 编辑了指向此位置的路径
- 冉
grails upgrade
- 编辑
application.properties
删除所有插件引用 - 编辑
Build.config
创建一个plugins
闭包来引用我的插件 - 冉
grails clean
- 冉
grails compile
步骤 7 失败并出现以下错误:
C:\code\querium\AppServer-grails-2>grails compile --stacktrace
| Compiling 98 source files
| Warning The [executeSafely] action accepts a parameter of type [groovy.lang.Closure] which has not been marked with @V
alidateable. Data binding will still be applied to this command object but the instance will not be validateable.
def executeSafely(Closure c) {
^
| Warning The [executeSafely] action accepts a parameter of type [groovy.lang.Closure] which has not been marked with @V
alidateable. Data binding will still be applied to this command object but the instance will not be validateable.
def executeSafely(Closure c) {
^
| Warning The [increment] action accepts a parameter of type [java.util.Map] which has not been marked with @Validateabl
e. Data binding will still be applied to this command object but the instance will not be validateable.
def increment(Map map, String t, int index) {
^
| Compiling 98 source files.
| Error Fatal error during compilation org.apache.tools.ant.BuildException: Compilation Failed (NOTE: Stack trace has be
en filtered. Use --verbose to see entire trace.)
java.lang.NullPointerException
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.codehaus.gant.GantBuilder.invokeMethod(GantBuilder.java:99)
at _GrailsCompile_groovy$_run_closure2_closure6_closure7.doCall(_GrailsCompile_groovy:48)
at _GrailsCompile_groovy$_run_closure2_closure6_closure7.doCall(_GrailsCompile_groovy)
at _GrailsCompile_groovy.withCompilationErrorHandling(_GrailsCompile_groovy:69)
at _GrailsCompile_groovy.this$4$withCompilationErrorHandling(_GrailsCompile_groovy)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:168)
at _GrailsCompile_groovy$_run_closure2_closure6.doCall(_GrailsCompile_groovy:47)
at _GrailsCompile_groovy$_run_closure2_closure6.doCall(_GrailsCompile_groovy)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at _GrailsCompile_groovy$_run_closure2.doCall(_GrailsCompile_groovy:46)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:1
85)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)
at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)
at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:427)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:415)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.executeTargets(Gant.groovy:591)
at gant.Gant.executeTargets(Gant.groovy:590)
| Error Fatal error during compilation org.apache.tools.ant.BuildException: Compilation Failed
我不确定真正的错误在哪里,以及如何纠正它。我很乐意忽略这些警告,除非有充分的理由来修复它们。(如果有,怎么做?)