5

自从我开始评估 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()])
}

由于pictureListpictureList.size()是 ArrayList 类型,这更有意义

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

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

| Compiling 1 source files
| Compiling 1 source files.
| Compiling 1 source files..
| Compiling 1 source files...

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

| 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

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

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

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

4

2 回答 2

4

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

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

这为我解决了这个问题

于 2011-12-23T05:06:24.307 回答
0

cntl + alt + G并在 Intellij Idea 中运行clean命令。它必须工作

为我工作

如果这不起作用,请将添加 enable.groovy.hotswap=false 添加到 /bin/idea.properties 然后运行​​clean

也有效!!

于 2014-07-25T05:09:04.253 回答