5

This error has been popping up lately since I started evaluating Grails 2.0.0.RC3. I make simple changes to a controller, then save.

From pictureList.count() which somehow worked in 1.3.7 but not in 2.0.0RC3

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

To pictureList.size() which makes more sense as pictureList is of type ArrayList

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

I get the compiling output message letting me know whats going on.

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

Then I reload the page and I get this.

| 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

Now the only way to recover from the error(that I've found out) is to restart the application.

Has anyone come across this issue?? I'll try to isolate the issue, if possible, so i can submit a bug report.

I should add that this app was originally based on grails 1.3.7 and I've recently upgraded it to 2.0.0RC1 and now to 2.0.0RC3

Charles
  • 50,943
  • 13
  • 104
  • 142
gotomanners
  • 7,808
  • 1
  • 24
  • 39

2 Answers2

4

Do you use Intellij Idea and run grails app with it? If so, you might try this temporary solution as offered on Idea's issue tracker:

add enable.groovy.hotswap=false to /bin/idea.properties and restart IDEA.

This fixed this issue for me

Anton N
  • 513
  • 1
  • 4
  • 9
  • Does this prevent reloading of the classes though? If so it isn't a great help - – Peter Jan 17 '12 at 21:32
  • This issue was a bug in intelliJ 10. Fixed it by going command line with grails, using a workaround outlined above or upgrading to Intellij 11 – gotomanners Jan 18 '12 at 05:22
  • Confirmed that adding enable.groovy.hotswap=false to /bin/idea.properties prevents the issue, and still allows changes to be reloaded by Grails on the fly. Nice workaround. – Peter Jan 18 '12 at 20:54
0

Press cntl + alt + G and run clean command in Intellij Idea.. it must work

Worked for me

if that doesn't work, add add enable.groovy.hotswap=false to /bin/idea.properties then run clean

Works too!!