Quartz job runs twice when deployed on tomcat 6/Ubuntu 10.04LTS Quartz job runs twice when deployed on tomcat 6/Ubuntu 10.04LTS spring spring

Quartz job runs twice when deployed on tomcat 6/Ubuntu 10.04LTS


I fixed it, not only quartz was running twice, but my app was deployed twice. This was because of the following in the Tomcat docs:

When using automatic deployment, the docBase defined by an XML Context file should be outside of the appBase directory. If this is not the case, difficulties may be experienced deploying the web application or the application may be deployed twice. The deployIgnore attribute can be used to avoid this situation.

Finally, note that if you are defining contexts explicitly in server.xml, you should probably turn off automatic application deployment or specify deployIgnore carefully. Otherwise, the web applications will each be deployed twice, and that may cause problems for the applications.

I followed a tutorial on how to get mod_jk working, and this tutorial contained that flaw.


For me, the auto deployment was the problem, and to disable it I had to specify the following attributes on the host element in my server.xml:

deployOnStartup="false"autoDeploy="false"

So my host element looked like this:

  <Host name="localhost"         deployOnStartup="false"          appBase="webapps"         unpackWARs="false"         autoDeploy="false">

I found this post detailing the problem in a different way that helped me resolve this issue.


Do you eventually have multiple applications running inside one Tomcat instance on your Ubunut machine? I think I remember Quartz to have some static code, which it would share througout all applications in one Java VM.