To resolve the problem, I have read through the source codes of Play framework 2.
It does not seem that the framework always call the 'onStop'
'onStop' is called only if the application runs with the command 'play run' and it's stopped by pressing CTRL + D.
As of version 2.0, in order to do something before the application stops, you need to use 'Runtime.getRuntime.addShutdownHook'.
It is the way that the play framework deletes the 'RUNNING_ID' file.
(see src/main/scala/play/core/server/NettyServer.scala)
You may get more information on 'addShutdownHook' from the below link.
http://blog.stefandeboey.be/riding-the-scala-wave
It'd be very helpful if the committers confirm this.
2012년 4월 20일 금요일 오전 10시 49분 39초 UTC+9, Justin 님의 말: