Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grails 2.0.0.RC3: Could not reload changes to controller, java.lang.NoSuchFieldException: __timeStamp__239_neverHappen1323622798918

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

like image 643
gotomanners Avatar asked Oct 10 '22 06:10

gotomanners


1 Answers

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

like image 84
Anton N Avatar answered Oct 14 '22 00:10

Anton N