2011-12-11 8 views
5

自從我開始評估Grails 2.0.0.RC3以來,此錯誤一直在彈出。 我對控制器進行了簡單的更改,然後保存。Grails 2.0.0.RC3:無法重新加載對控制器的更改,java.lang.NoSuchFieldException:__timeStamp__239_neverHappen1323622798918

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()]) 
} 

pictureList.size()這使得更多的意義,因爲pictureList的類型是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

+0

你有沒有試過在郵件列表上提問? – Antoine

+0

我也遇到過2.0.0.RC3。如果你可以一直重複它,我會建議提交一個錯誤報告 –

+0

同樣在這裏,非常討厭。 – Peter

回答

4

你使用的IntelliJ IDEA和運行的Grails應用它? 如果是的話,你可能會思想的issue tracker作爲提供嘗試這種治標不治本:

添加enable.groovy.hotswap = false來/bin/idea.properties並重新啓動IDEA。

此修復了這個問題對我來說

+0

這是否阻止了類的重新加載?如果是這樣,這不是一個很好的幫助 - – Peter

+0

這個問題是intelliJ中的一個錯誤10.通過使用grails的命令行解決它,使用上述的解決方法或升級到Intellij 11 – gotomanners

+0

確認添加了enable.groovy.hotswap = false到/bin/idea.properties可以避免這個問題,並且仍然允許Grails在運行中重新加載更改。很好的解決方法。 – Peter

0

CNTL + ALT + G並運行IntelliJ IDEA的乾淨命令..它必須努力

爲我工作

如果不起作用,添加enable.groovy.hotswap = false到/bin/idea.properties然後運行clean

也可以!