Grails 2.0.0.RC3:无法重新加载对控制器的更改,java.lang.NoSuchFieldException:__ timeStamp__239_neverHappen1323622798918

got*_*ers 5 grails grails-controller

自从我开始评估Grails 2.0.0.RC3以来,最近出现了这个错误.我对控制器进行了简单的更改,然后保存.

pictureList.count()某种程度上在1.3.7中起作用但在2.0.0RC3中起作用

def tagged = {
        def pictureList = Picture.findAllByTag(params.id)
        render(view: 'list', model: [pictureInstanceList:pictureList, 
            tag:params.id, pictureInstanceTotal:pictureList.count()])
}
Run Code Online (Sandbox Code Playgroud)

为了pictureList.size()使更多的意义,因为pictureList的类型是ArrayList

def tagged = {
        def pictureList = Picture.findAllByTag(params.id)
        render(view: 'list', model: [pictureInstanceList:pictureList, 
            tag:params.id, pictureInstanceTotal:pictureList.size()])
}
Run Code Online (Sandbox Code Playgroud)

我收到编译输出消息让我知道发生了什么.

| Compiling 1 source files
| Compiling 1 source files.
| Compiling 1 source files..
| Compiling 1 source files...
Run Code Online (Sandbox Code Playgroud)

然后我重新加载页面,我得到了这个.

| Error 2011-12-11 17:00:01,908 [Thread-7] ERROR plugins.AbstractGrailsPluginManager  
- Plugin [controllers:2.0.0.RC3] could not reload changes to file 
[/Users/gotomanners/Documents/Projects/sampleProject/grails-app/controllers/sampleProject/PictureController.groovy]: 
java.lang.NoSuchFieldException: __timeStamp__239_neverHappen1323622798918
Message: java.lang.NoSuchFieldException: __timeStamp__239_neverHappen1323622798918
   Line | Method
->> 632 | doCall in SpringSecurityCoreGrailsPlugin$_closure5
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
^   680 | run    in java.lang.Thread

Caused by NoSuchFieldException: __timeStamp__239_neverHappen1323622798918
->> 1882 | getDeclaredField in java.lang.Class
Run Code Online (Sandbox Code Playgroud)

现在,从错误中恢复的唯一方法(我发现)是重启应用程序.

有人遇到过这个问题吗?如果可能的话,我会尝试隔离问题,这样我就可以提交错误报告.

我应该补充说,这个应用程序最初基于grails 1.3.7,我最近将其升级到2.0.0RC1,现在升级到2.0.0RC3

Ant*_*n N 4

您使用 Intellij Idea 并用它运行 grails 应用程序吗?如果是这样,您可以尝试 Idea问题跟踪器上提供的临时解决方案:

将enable.groovy.hotswap=false添加到/bin/idea.properties并重新启动IDEA。

这为我解决了这个问题