I have a quartz job in my web application that runs a servlet. When I redistribute my application, I get the following message
[DefaultQuartzScheduler_Worker-5] but has failed to stop it. This is very likely to create a memory leak
Also in production, there is a problem that the tomcat server does not stop after. /shutdown.sh, so we need to kill the process. In my opinion, it depends on the work of quartz, which cannot stop.
How can I stop a quartz job by redeploying my application or shutting down the server?
I am using tomcat 7, quartz 2.1.6 ...
SchedulerFactory sf = new StdSchedulerFactory(); Scheduler scheduler = sf.getScheduler(); scheduler.start(); JobDetail job = JobBuilder.newJob(XYZJob.class).withIdentity("job1", "group1").build(); Trigger trigger = TriggerBuilder.newTrigger().withIdentity("trigger1","group1") .startNow() .withSchedule(CronScheduleBuilder.cronSchedule("0 0 1 * * ?")) .build(); scheduler.scheduleJob(job, trigger);
As you can see, my work begins once a day. I do not see a place where I can check the flag to cancel the task.
source share