title: Quartz job for Grails only fires once
body: <p>I am trying to setup a cron job in my Grails web application using the <a href="http://grails.org/plugin/quartz" rel="nofollow">Quartz plugin</a>. I am currently simply trying to get a test job to execute once every second using the following code:</p>
  
  <pre><code>class TestJob {
      private int counter = 0
      static triggers = {
          simple repeatInterval: 1000
      }
  
      def execute() {
          // execute job
          counter += 1
          System.out.println("Testing the cron " + counter)
      }
  }
  </code></pre>
  
  <p>However, when I run the application I only see the initial output of the first <code>execute()</code> call twice: once immediately before I am alerted that the server is running, and once immediately after.</p>
  
  <pre><code>| Loading Grails 2.1.0
  | Configuring classpath.
  | Environment set to development.....
  | Packaging Grails application.....
  | Compiling 1 source files.....
  | Running Grails application
  Testing the cron 1
  | Server running. Browse to http://localhost:8080/QuartzTest
  Testing the cron 1
  </code></pre>
  
  <p>Does anyone know why my Quartz job might not be firing correctly? I have tried using a cron instead of simple as well as using varying parameters, time intervals, etc. Nothing has made a difference. </p>
  
  <p>Thanks</p>