Skip navigation

Category Archives: grails

I ran across an issue today where my Grails app was stuck in an infinite loop “compiling” on startup.

Command line symptons revealed the following:

Running Grails application..
Server running. Browse to http://localhost:8080/foo
[groovyc] Compiling 1 source file to /Users/cs44/.grails/1.1/projects/foo/classes
[groovyc] Compiling 1 source file to /Users/cs44/.grails/1.1/projects/foo/classes
Running Grails application..

Over and over….

Turns out I had a compiliaton failure of a groovy file in my “/src/groovy” directory. It sure would have been nice to ACTUALLY know of this compilation error as it happened. That said, the only way to find the culprit file is change to your grails class directory, which on my OS X box is the following: ~/.grails/1.1/projects/watch/classes

Next up — in a new shell, you’ll want to start the application, forcing the infinite compilation loop. While the app is failing to startup, run the following command in your classes directory: find . -name “*class” -ls

This will list all .class files, including our failed file(s), plus an “ls” style directory listing. From here examine the last modifed date and you should find your culprit.

Remove said file and recompile.

Hope that helps someone! I certainly chased my tail for bit…