Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quartz Scheduler suddenly stop running and no exception error

People also ask

How do you trigger Quartz Scheduler?

All the Jobs registered in the Quartz Scheduler are uniquely identified by the JobKey which is composed of a name and group . You can fire the job which has a given JobKey immediately by calling triggerJob(JobKey jobKey) of your Scheduler instance. // Create a new Job JobKey jobKey = JobKey.

How do I start Quartz Scheduler in web application?

As a first step create a web application and keep all the Quartz Scheduler dependent jars in classpath. Put the quartz. properties and jobs XML file under classes folder. The configuration of the above job is defined in the job configuration XML file.

How do I stop a Quartz Scheduler in Java?

deleteJob(jobKey(<JobKey>, <JobGroup>)); This method will only interrupt/stop the job uniquely identified by the Job Key and Group within the scheduler which may have many other jobs running. scheduler. shutdown();

How do I Unschedule a Quartz job?

We can unschedule a Job by calling the unschedule() method of the Scheduler class and passing the TriggerKey . If the related job does not have any other triggers, and the job is not durable, then the job will also be deleted.


I had a similar problem but the problem was, I had 10 threads quartz default number of threads in quartz properties and when I made thread dump* I found that I have 10 jobs in blocked stat, which means that I can't run any more threads.

A quick fix to this problem to increase the number of threads in the thread pool in the quartz properties.

The actual fix was reviewing my code to know why I had a 10 blocked threads.

*to do thread dump you can use kill -3 < java process number > which print the thread dump to your application standard output i.e if you running tomcat you find it in catalina.out log file


In my case I had an open connection to the database. When the I had no more connections available, my threads remained waiting forever. As I could not start any other jobs, nothing happened and everything stayed blocked. My advice is for you to check if you have any blocking resource that you might need to release.


If you are using a database to store jobs, check the trigger_state of your trigger. Right now I'm seeing a similar problem (or at least it has similar symptoms).

A job that runs once a minute is leaving the trigger in "ACQUIRED" state and will never run again. Like you I'm seeing nothing the the log.

I'm also seeing a different cause of the same problem. Again, the job just stops running, but the trigger is not in the "ACQUIRED" state. So far I don't know the cause.

What I know so far is that the scheduler thread is waiting for a free worker thread. It looks like all of the worker threads are waiting for a semaphore in order to update their schedule. I haven't been able to get a thread dump yet to verify what the worker threads are waiting on.

I'm running Quartz 1.6.1 RC1. See this bug report: http://jira.opensymphony.com/browse/QUARTZ-668

I think that's what I'm seeing.


Check if any Job is throwing an Exception. Put your Job exe code in a try catch block an trace any exception to troubleshoot the problem.