Playframework and Global.onStart

When I launch the application in DEV (play run) mode, my Global.onStart method does not execute. But if I run my application, then Global.onStart works as it should.

How can I execute Global.onStart using "play run"?

I am using java version 2.0.2

+5
source share
3 answers

In dev mode, onStart is called with the first request

That was the answer to my question - thanks!

+6
source

When you add a method to a global object, you may have to kill the current application and restart it in order to reload your changes.

0
source

application.mode, conf, , play run play start dev prod .

Nevertheless, given the differences between the modes (more details here ), namely

Playback starts the application right away (including any job loading), instead of waiting for the first request, again adding a slight performance advantage for the first use

You may need to play startor change the PROD mode in your configuration file.

-1
source

All Articles