title: Quartz Scheduler not running
body: <p>I wanted to post a message after every five seconds in my web app, i am using Quatz to schedule this task. Here's my Code</p>
  
  <pre><code>public class InvoiceGenerationSchedular implements ServletContextListener {
  
  @Override
  public void contextDestroyed(ServletContextEvent arg0) {
      System.out.println("Listener is off");
  }
  
  @Override
  public void contextInitialized(ServletContextEvent servletContextEvent) {
      System.out.println("Listener initialized.");
  
      JobDetail job = JobBuilder.newJob(HelloJob.class)
              .withIdentity("dummyJobName", "group1").build();
      Trigger trigger = TriggerBuilder
              .newTrigger()
              .withIdentity("dummyTriggerName", "group1")
              .withSchedule(
  
      CronScheduleBuilder.cronSchedule("0/5 * * * * ?")).build();
  
              //schedule it
      Scheduler scheduler;
          try {
              scheduler = new StdSchedulerFactory().getScheduler();               
              scheduler.start();
              scheduler.scheduleJob(job, trigger);
  
          } catch (SchedulerException e) {                    
              e.printStackTrace();            
          }
  
  }
  
  class HelloJob implements Job
  {
  
      @Override
      public void execute(JobExecutionContext arg0) throws JobExecutionException {
          System.out.println("Hello Quartz!");            
      }   
  }}
  </code></pre>
  
  <p>and my web.xml is </p>
  
  <pre><code>    &lt;servlet&gt;
          &lt;servlet-name&gt;InvoiceGenerationServlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;InvoiceGenerationSchedular&lt;/servlet-class&gt;
  &lt;/servlet&gt;  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;InvoiceGenerationServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/InvoiceGenerationServlet&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;  
  &lt;listener&gt;
          &lt;listener-class&gt;InvoiceGenerationSchedular&lt;/listener-class&gt;
  &lt;/listener&gt;
  </code></pre>
  
  <p>Now the Problem is every time i run the code it gives me only The output</p>
  
  <p>Listener Initialized </p>
  
  <p>and nothing else , though i wanted it to print "Hello Quartz" after every 5 seconds but it prints nothing. I don't understand why, doesn't give me any exception either. I am very new to Quartz so that's why i don't know how to solve this problem . I of-course googled my problem first but didn't get much answer.</p>