We have an application deployed on Tomcat 6. It’s built on Spring/Struts 2, and has several Quartz tasks scheduled.
We’d like to move some tasks away from Quartz and onto Linux’s cron, doing the very least amount of coding as possible. How do I run those Spring/Quartz tasks outside the Tomcat container and in a standalone Java application?
(UPDATE: Since someone wanted to know why we want to do this)
We wanted to move the scheduled tasks to their own Java applications because our Tomcat keeps dying on us. There are no errors logged. We suspect that this one huge Quartz task we have is the culprit, but whether it’s because of a memory leak or our Tomcat seg-faulting due to being set-up incorrectly, we still don’t know.
We wanted to isolate it by kicking it out of the Tomcat container, and see if Tomcat will still die intermittently. However, since the application is already live (though in closed beta), we wanted to troubleshoot this with the least amount of coding work, while still keeping it running (coz, you know, “new code, new problems” — FYI, we’re already considering a rewrite/re-engineering, but “firefighting” is a more urgent concern right now).
Apparently, the simplest way to go about this is to create a standalone Java application that calls the bean method you’re executing in Quartz:
..then, running this in cron.
Meh.