1

I just got a chance to test-drive a VPS for a week, and decided to try Grails on it. The problem is, that it shuts itself down.

Details:

  • VPS - 512MB Ram, Ubuntu 12.10 x64 (no particular reason for x64)
  • Oracle Java 7u17
  • Latest GVM 0.9.5
  • Grails 2.2.1

What I did was follow along this tutorial http://grails.org/Quick+Start, which is very basic. Everything went smooth until I did grails run-app.

After doing the initialization, it showed running for like 5s, and I could even start loading the page, but it suddenly showed Killed in the terminal. This is what the terminal showed:

root@jp:/var/grails/my-project# grails run-app
| Running Grails application
Killed

There was no input during that time whatsoever. Any ideas on the cause of this problem?

Janis Peisenieks
  • 4,938
  • 10
  • 55
  • 85

2 Answers2

2

You should only ever run Grails with the run-app command when developing locally. The reason behind this is because run-app starts your Grails app with a lot of dynamic behavior that is great for rapid development, but horrible performance-wise for running on an actual server.

Refer to Grails' User Guide on how best to deploy your application:

http://grails.org/doc/latest/guide/gettingStarted.html#deployingAnApplication

As the docs above state, the correct way to run your Grails app is to embed it in a servlet container. Tomcat is a good place to start since Grails uses that by default when running locally. You may also need to play around with the VM flags of your servlet container, depending on your environment (again, the docs give a few suggestions here).

Rhysyngsun
  • 951
  • 6
  • 17
  • I am well aware of this. Now even though this is not a local envoirnment, i am currently treating this as one. Could the dynamic behaviour be the reason why the app is being killed? And if so, why couldn't I find anything about this case? – Janis Peisenieks Apr 02 '13 at 22:33
  • The kernel is killing the app. See: http://stackoverflow.com/questions/726690/who-killed-my-process-and-why – Rhysyngsun Apr 03 '13 at 15:39
0

You can redirect output of your command if it get's killed immediately on your terminal.

grails run-app > output.txt

Then open output.txt and from there you can dissect the problem. For my case, i got an incorrect JAVA_HOME directory. Hope it helps.

Petra
  • 724
  • 1
  • 6
  • 14