title: Quartz firing twice bean caching issue?
body: <p>spring-report.xml</p>
  
  <pre><code>&lt;bean id="scheduleReportEmailJob"
        class="org.springframework.scheduling.quartz.JobDetailBean"&gt;
      &lt;property name="jobClass"
                value="schedule.ReportQuartzJobBean"/&gt;
      &lt;property name="jobDataAsMap"&gt;
          &lt;map&gt;
              &lt;entry key="reportService" value-ref="reportService"/&gt;
          &lt;/map&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  
  &lt;bean id="cronEmailTrigger"
        class="org.springframework.scheduling.quartz.CronTriggerBean"&gt;
      &lt;property name="jobDetail" ref="scheduleReportEmailJob"/&gt;
      &lt;property name="cronExpression" value="0 0,15,30,45 * ? * MON-FRI"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"&gt;
      &lt;property name="triggers"&gt;
          &lt;list&gt;
              &lt;ref bean="cronEmailTrigger"/&gt;
          &lt;/list&gt;
      &lt;/property&gt;
      &lt;property name="quartzProperties"&gt;
          &lt;props&gt;
              &lt;prop key="org.quartz.scheduler.instanceName"&gt;Reports&lt;/prop&gt;
              &lt;prop key="org.quartz.scheduler.instanceId"&gt;FirstInstance&lt;/prop&gt;
              &lt;prop key="org.quartz.scheduler.rmi.export"&gt;false&lt;/prop&gt;
              &lt;prop key="org.quartz.scheduler.rmi.proxy"&gt;false&lt;/prop&gt;
              &lt;prop key="org.quartz.threadPool.class"&gt;org.quartz.simpl.SimpleThreadPool&lt;/prop&gt;
              &lt;prop key="org.quartz.threadPool.threadCount"&gt;1&lt;/prop&gt;
              &lt;prop key="org.quartz.jobStore.class"&gt;org.quartz.simpl.RAMJobStore&lt;/prop&gt;
              &lt;prop key="org.quartz.scheduler.jobFactory.class"&gt;org.quartz.simpl.SimpleJobFactory&lt;/prop&gt;
          &lt;/props&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <hr>
  
  <pre><code>private static BeanFactory factory = new ClassPathXmlApplicationContext("spring-report.xml");
  </code></pre>
  
  <p>When I start tomcat </p>
  
  <pre><code>2011-02-07 06:46:57,005(ISO8601) [main] DEBUG   org.springframework.beans.factory.support.DefaultListableBeanFactory  - Invoking afterPropertiesSet() on bean with name 'scheduler'
  2011-02-07 06:46:57,083(ISO8601) [main] INFO    org.quartz.core.SchedulerSignalerImpl  - Initialized Scheduler Signaller of type: class org.quartz.core.Schedu
  lerSignalerImpl
  2011-02-07 06:46:57,083(ISO8601) [main] INFO    org.quartz.core.QuartzScheduler  - Quartz Scheduler v.1.6.3 created.
  2011-02-07 06:46:57,084(ISO8601) [main] INFO    org.quartz.core.QuartzScheduler  - JobFactory set to: org.quartz.simpl.SimpleJobFactory@3dd510be
  2011-02-07 06:46:57,085(ISO8601) [main] INFO    org.quartz.simpl.RAMJobStore  - RAMJobStore initialized.
  2011-02-07 06:46:57,085(ISO8601) [main] INFO    org.quartz.impl.StdSchedulerFactory  - Quartz scheduler 'Reports' initialized from an externally provided prop
  erties instance.
  2011-02-07 06:46:57,085(ISO8601) [main] INFO    org.quartz.impl.StdSchedulerFactory  - Quartz scheduler version: 1.6.3
  2011-02-07 06:46:57,087(ISO8601) [main] INFO    org.quartz.core.QuartzScheduler  - JobFactory set to: org.springframework.scheduling.quartz.AdaptableJobFactor
  y@206fa7ec
  2011-02-07 06:46:57,094(ISO8601) [main] INFO    org.springframework.scheduling.quartz.SchedulerFactoryBean  - Starting Quartz Scheduler now
  2011-02-07 06:46:57,094(ISO8601) [main] INFO    org.quartz.core.QuartzScheduler  - Scheduler Reports_$_FirstInstance started.
  2011-02-07 06:46:57,139(ISO8601) [main] DEBUG   org.springframework.beans.factory.support.DefaultListableBeanFactory  - Finished creating instance of bean 'sc
  heduler'
  2011-02-07 06:46:57,140(ISO8601) [main] DEBUG   org.springframework.context.support.ClassPathXmlApplicationContext  - Publishing event in context [org.springf
  ramework.context.support.ClassPathXmlApplicationContext@4275b35]: org.springframework.context.event.ContextRefreshedEvent[source=org.springframework.context.s
  upport.ClassPathXmlApplicationContext@4275b35: display name [org.springframework.context.support.ClassPathXmlApplicationContext@4275b35]; startup date [Mon Fe
  b 07 06:46:55 EST 2011]; root of context hierarchy]
  </code></pre>
  
  <p>Jobs fires twice after some time after I start tomcat, if i remove all the cache from the work directory and the exploded war file and re deploy it fires the job only once. any ideas ? maybe  caching the bean ?</p>
  
  <p>@jhouse the re deploy seems to be the problems I've pasted the thread dump after it's being redeployed, what are my options ? </p>
  
  <p>@jhouse</p>
  
  <p>"Reports_QuartzSchedulerThread" prio=10 tid=0x00002aab0c10b000 nid=0x1dc0 in Object.wait() [0x0000000044501000]
     java.lang.Thread.State: TIMED_WAITING (on object monitor)
      at java.lang.Object.wait(Native Method)
      - waiting on &lt;0x00002aaac9e6d298> (a java.lang.Object)
      at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:433)
      - locked &lt;0x00002aaac9e6d298> (a java.lang.Object)</p>
  
  <p>"Reports_Worker-1" prio=10 tid=0x00002aab0c10a800 nid=0x1dbf in Object.wait() [0x0000000044400000]
     java.lang.Thread.State: TIMED_WAITING (on object monitor)
      at java.lang.Object.wait(Native Method)
      - waiting on &lt;0x00002aaac9e4c980> (a org.quartz.simpl.SimpleThreadPool$WorkerThread)
      at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:519)
      - locked &lt;0x00002aaac9e4c980> (a org.quartz.simpl.SimpleThreadPool$WorkerThread)</p>
  
  <p>"Reports_QuartzSchedulerThread" prio=10 tid=0x00002aab0841b800 nid=0x1da3 in Object.wait() [0x0000000041715000]
     java.lang.Thread.State: TIMED_WAITING (on object monitor)
      at java.lang.Object.wait(Native Method)
      - waiting on &lt;0x00002aaac4fc71d0> (a java.lang.Object)
      at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:433)
      - locked &lt;0x00002aaac4fc71d0> (a java.lang.Object)</p>
  
  <p>"Reports_Worker-1" prio=10 tid=0x00002aab091a3000 nid=0x1da2 in Object.wait() [0x0000000041614000]
     java.lang.Thread.State: TIMED_WAITING (on object monitor)
      at java.lang.Object.wait(Native Method)
      - waiting on &lt;0x00002aaac4e21b10> (a org.quartz.simpl.SimpleThreadPool$WorkerThread)
      at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:519)
      - locked &lt;0x00002aaac4e21b10> (a org.quartz.simpl.SimpleThreadPool$WorkerThread)</p>
  
  <p>If I stop the server, then check the thread dump it's empty, then start (without cleaning) the server,the threadump has duplicate threads running </p>