@Override
 public void contextInitialized(ServletContextEvent servletContextEvent) {
   logger.info("Starting up, checking that configuration is correct");
   try {
     checkConfiguration();
     this.jobStarter = new JobStarter();
     jobStarter.scheduleTasks();
   } catch (Exception ex) {
     logger.error("Failed to initialize application", ex);
     throw ex;
   }
 }
 @Override
 public void contextDestroyed(ServletContextEvent servletContextEvent) {
   logger.info("Shutting down");
   jobStarter.dispose();
 }