Sorry if this question becomes stupid, but I just canβt find my mistake, and I already checked a lot of posts here in SO and other sites. I created a Play 2.3.7 project using Java. I created the Global.java file in a common package in the application directory. In this file, I override onStart (and other hooks), but I do not make them work. They simply are not executed at all. Here is the Global.java file:
package common; import play.Application; import play.GlobalSettings; import play.Logger; public class Global extends GlobalSettings { @Override public void beforeStart(Application application) { Logger.error("good bye cruel world"); super.beforeStart(application); throw new RuntimeException("WTF"); } @Override public void onStart(Application application) { Logger.error("good bye cruel world"); super.onStart(application); throw new RuntimeException("WTF"); } @Override public void onStop(Application application) { Logger.error("good bye cruel world"); super.onStop(application); throw new RuntimeException("WTF"); } }
And inside application.conf, here is the corresponding part, which is commented out by default:
# Define the common.Global object class for this application. # Default to common.Global in the root package. # application.global=common.Global
What could be the problem? Thanks.
ale64bit
source share