Quartz Failure On Job Recovery

user4786688

I'm new to JSP and Quartz Scheduling! In this project, I'm trying to make the quartz scheduler continue functioning in case the server is turned off then on ignoring the missed jobs.

For this, I researched JobPersistence and I have modified the quartz.properties file as the following:

org.quartz.threadPool.threadCount=5
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.tablePrefix = QRTZ_
org.quartz.jobStore.useProperties = true
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
org.quartz.jobStore.dataSource = myDB
org.quartz.dataSource.myDB.driver = com.mysql.jdbc.Driver
org.quartz.dataSource.myDB.URL = jdbc:mysql://localhost:3306/contacts
org.quartz.dataSource.myDB.user = root
org.quartz.dataSource.myDB.password = root

the web.xml file contains the following:

...
<listener>
  <listener-class>
     org.quartz.ee.servlet.QuartzInitializerListener
  </listener-class>
</listener>
...

I've added the tables to the DB and when I select I can see that it really inserted triggers to its tables.

The trigger is built as the following:

Trigger trig = TriggerBuilder
.newTrigger()
.startAt(scal.getTime())
.withSchedule(
    SimpleScheduleBuilder.simpleSchedule()
    .withIntervalInMinutes(minutes).repeatForever())
    .endAt(ecal.getTime()).build();

Now, when I run my web app, I schedule a job and it executes. Then, I turn off the tomcat server and start it again. It prints the following error to the logger:

org.quartz.SchedulerConfigException: Failure occured during job recovery. [See nested exception: org.quartz.JobPersistenceException: Couldn't recover jobs: null [See nested exception: java.lang.NullPointerException]]

I have tried executing the following statement once in MySQLWorkbench:

UPDATE QRTZ_TRIGGERS SET NEXT_FIRE_TIME=1 WHERE NEXT_FIRE_TIME < 0;

Now, I got this new error:

.manage - MisfireHandler: Error handling misfires: Unexpected runtime exception: null

org.quartz.JobPersistenceException: Unexpected runtime exception: null [See nested exception: java.lang.NullPointerException]

If you want me to edit and include the stackTrace, I can do that...

user4232819

You may want to use in the properties file

org.quartz.scheduler.misfirePolicy =  doNothing

Because apparently the missed jobs are causing you problems...

I know this is an old post but if you have an answer then please share it with us all !

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Namenode failure and recovery in Hadoop

From Dev

Schedule a job in quartz with a set of triggers

From Dev

Quartz job retrigerring after server shutdown

From Dev

Grails Transaction in Quartz Job

From Dev

Quartz: repeat job always on monday through friday

From Dev

Spring Quartz : Job does not fire

From Dev

Pentaho job communication failure

From Dev

Quartz Error Misfire Handling and Failure on Job Recovery

From Dev

Data persistence for a quartz job which exits with an exception?

From Dev

Quartz.NET inject property in a job

From Dev

Run Quartz job synchronous

From Dev

How to mark job as durable in Quartz .net?

From Dev

Cloud Dataflow failure recovery

From Dev

Cron job syntax for Quartz Jobs

From Dev

Stop Quartz Job on local machine

From Dev

Quartz Scheduler Job Auto Termination

From Dev

Difference between Quartz Job and Scheduling Tasks with Spring?

From Dev

Quartz Job Annotation @DisallowConcurrentExecution Implementation

From Dev

Quartz scheduler not running the cron job

From Dev

recovery data from RAID and disk failure (Linux)

From Dev

STP recovery on tree root failure and recovery?

From Dev

How to orchestrate a clustered Quartz job

From Dev

Pentaho job communication failure

From Dev

Unable to instantiate Quartz job in spring

From Dev

Quartz Error Misfire Handling and Failure on Job Recovery

From Dev

how to schedule a quartz job with scala

From Dev

Spring Quartz Triggering Job programmatically

From Dev

Add calendar to Quartz job by configuration

From Dev

Flink job/data flow on multiple task managers failure and recovery