Say I have some tomcat webapp with a quartz job that runs hourly, I've tested it fine on an environment that has one instance of this application running. No duplicate runs, all is as expected.
Now I move this application out to a machine that has two environments running concurrently - DEV and QA. They run on separate JDKs, and have separate tomcat installations: /myapp/tomcatD and /myapp/tomcatQ.
ps -ef
...
admin 32089 1 2 10:14 pts/2 00:01:53 /myapp/java/jdk1.6.0_45_QA/jre/bin/java -Djava.util. ...
admin 32296 1 99 11:44 pts/2 00:00:06 /myapp/java/jdk1.6.0_45_DEV/jre/bin/java -Djava. ...
At first, I deploy the same build and scheduler.xml to just DEV. It works fine for weeks. Now I deploy to QA and notice that QA has duplicate runs of my scheduled jobs in its logs, and DEV's as well.
I schedule DEV's jobs to run at:
<value>30 0 * ? * *</value><!-- Every hour on :00 minute :30 second -->
And QA's jobs to run at:
<value>0 0 * ? * *</value><!-- Every hour on :00 minute -->
I observe each log has one run on the XX:00:00 and XX:00:30.
At first I am lead to believe that they are simply logging each other's jobs. However when I shut down DEV, I noticed that QA still runs a second instance of the job. I also tried restarting QA with dev still up and that did not work either - duplicate runs still happened. I also tried replacing DEV's scheduler.xml with one that has all jobs commented out. No success.
What is going on behind the scenes in regard to Quartz? There must be some caching of these jobs that persists even when the applications are shut down or restarted.
Moreover, is there some Quartz process outside of these applications that allows them to run eachother's jobs?
Revisiting this with the solution in case it helps anyone - there was no issue with quartz, nothing funny going on with the xml.
The only problem was someone copied + pasted the application directory in webapp to a different folder that nobody knew about. 2 apps were running simultaneously.
tomcat
webapps
myapp
examples
some_devious_person_copied_myapp_here and it was running alongside the other one, causing duplicate instances of the jobs