Stormshadow
Stormshadow

Reputation: 7179

Bootstrapping Play Application

I want to run some code on starting a Play Application. This does not seem to work. Any clues ?

public class Global extends GlobalSettings {

    @Override
    public void onStart(Application app) {
        Logger.info("Foo Fee Fi");
    }

}

Upvotes: 0

Views: 123

Answers (2)

user1411778
user1411778

Reputation: 461

Is your Global class in the default package? It should be, otherwise you have to define its location in application.conf:

# Global object class
# ~~~~~
# Define the Global object class for this application.
# Default to Global in the root package.
global=mypackage.MyGlobal

Upvotes: 5

James Ward
James Ward

Reputation: 29433

It's possible that you are extending the wrong object or have put your object in the wrong package. For more details check out the docs on the Global object for Java or Scala.

Upvotes: 2

Related Questions