Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My Grails App Server keeps restarting over and over

Tags:

grails

I was making various small changes to my app and at some point the grails app server decides that it needs to restart over and over and over.

Anybody else seen this crazy behavior. I cannot really upload my whole app as an example. I have no idea what I did. I wasn't making any configuration changes or plugin changes.

I'm using grails 1.2.

-- As I wrote this email, I tried it again and I get a slightly different behavior.

It goes to restart the app and gives the message that it is Compiling 1 Source file and keeps recompiling the one message.

like image 968
Andrew Avatar asked Jan 23 '10 03:01

Andrew


2 Answers

Not sure if this is your problem, but I've observed something like this when there is something minor wrong with one of your class names or packages, i.e. say you have a package org.grails.plugin in directory org.grails.foo. That for some reason causes recompilation.

To catch some of this errors, I modified my GRAILS_HOME\scripts_GrailsCompile.groovy by making it print out the files it's compiling.

To modify:

search for ant.groovyc and add listfiles:"yes" to the parameters.

Example:

ant.groovyc(destdir:classesDirPath,
  classpathref:classpathId,
  listfiles:"yes",
  encoding:"UTF-8",
  compilerPaths.curry(classpathId, false)
) 

This way if you see the exact same files keeps getting recompiled, you know where to look.

like image 95
Jean Barmash Avatar answered Nov 14 '22 09:11

Jean Barmash


Many thanks to kdj for pointing out that future timestamps can cause the continuous restart error as well.

So there are at least two ways continuous restart can happen 1) package names do not match folder structure 2) One or more class files have future timestamps relative to the server date

In my case, something odd happened on my dev box during the DST changeover and timestamps on some generated class files were set 2 days in the future.

like image 43
halfread Avatar answered Nov 14 '22 08:11

halfread