I am running Tomcat 4.1.27 and am using Quartz to schedule a job at regular intervals. The task of the job is to get from the database any outstanding quotation requests, send an email to the respective parties, and then update the database to indicate that the request is no longer outstanding. I noticed that multiple emails were being sent to the same supplier for the same request, and having added some debug code, it appears that the job is running multiple times each time it is scheduled to run. I also noticed that when I added further debug information, the old version of the class ran AND so did the new version. I am assuming it is a class loading issue as the job implements StatefulJob (which is supposed to prevent concurrent running) and the delegate which the job calls is a Singleton (which is also running concurrently).
I can't understand why my job is loaded by more than one class loader - and (as you'd expect) I'd really like to avoid it. Can anybody tell me what I can do to resolve this problem?
Where you've explicitly defined your app's context in server.xml and placed it in the root directory of the host (tomcat/webapps I assume), I wonder if Tomcat deployed it twice.
Did you shut off autoDeploy (in the Host node of server.xml)?
Try using the manager app to list all deployed apps and see if it got deployed twice. If you don't have the manager app installed, you could add a context listener that logs something when the app starts up.
Joined: Jan 22, 2002
The manager app only lists the application once. autoDeploy is set to true. The other piece of information worthy of note is that I have a handful of Quartz jobs scheduled, but this is the only one that seems to run multiple times.
The job config for this particular job is as follows: