title: Play java framework Initializing variables on application startup in
body: <p>I want to initialise some variables on application startup in Play framework. I'm following this document <a href="http://www.playframework.com/documentation/2.2.x/JavaGlobal" rel="nofollow">http://www.playframework.com/documentation/2.2.x/JavaGlobal</a> for doing the same..
  However when I run the application I get with the command "play run" the initialization does not happen. Am I doing something wrong here?</p>
  
  <pre><code>import com.Constants;
  
  import controllers.Application;
  import controllers.Utils;
  import play.*;
  
  public class Global extends GlobalSettings {
    public void onStart(Application app) throws Exception {
      Logger.info("Application has started");
      Constants.data1= Utils.getMerchantToBrMapping(Utils.getMerchantName());
      Constants.data2 = Utils.getBrToMerchantMapping(Utils.getMerchantName());
      Logger.info("Loaded the Merchant To BR Map");
    }
  }
  </code></pre>