java - org.quartz.JobPersistenceException : Couldn't acquire next trigger: ERROR: null value in column "sched_time" violates not-null constraint,

标签 java postgresql quartz-scheduler

import static org.quartz.JobBuilder.newJob;

import org.quartz.CronScheduleBuilder;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.Trigger;
import org.quartz.TriggerBuilder;
import org.quartz.impl.StdSchedulerFactory;
import static org.quartz.SimpleScheduleBuilder.*;

public class QuartzTest {
    public static void main(String[] args) {
        try {
            Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler();
            JobDetail jobDetail = newJob(HelloJob.class).withIdentity("Hello Job").build();
            Trigger trigger = TriggerBuilder
                    .newTrigger()
                    .withIdentity("dummyTriggerName", "group1")
                    .withSchedule(
                            /*CronScheduleBuilder.cronSchedule("0/5 * * * * ?")*/
                            simpleSchedule().
                                    withIntervalInSeconds(15).
                                    repeatForever()
                    )
                    .build();
            // and start it off
            scheduler.start();
            scheduler.scheduleJob(jobDetail, trigger);
            // scheduler.shutdown();
        } catch (SchedulerException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}

错误:

org.quartz.JobPersistenceException: Couldn't acquire next trigger: ERROR: null value in column "sched_time" violates not-null constraint Detail: Failing row contains (StepScheduler, NON_CLUSTERED1466000944643, dummyTriggerName, group1, NON_CLUSTERED, 1466015299949, null, 5, ACQUIRED, null, null, f, f). [See nested exception: org.postgresql.util.PSQLException: ERROR: null value in column "sched_time" violates not-null constraint Detail: Failing row contains (DecisionIQStepScheduler, NON_CLUSTERED1466000944643, dummyTriggerName, group1, NON_CLUSTERED, 1466015299949, null, 5, ACQUIRED, null, null, f, f).]

有人可以帮我解决这个问题吗?

最佳答案

这是由于 quartz-scheduler.jar 和 SQL 模式文件之间的版本不匹配。

关于java - org.quartz.JobPersistenceException : Couldn't acquire next trigger: ERROR: null value in column "sched_time" violates not-null constraint,,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37843145/

相关文章:

java - 由可以处理分页/排序的数据库支持的大型 JSF dataTable

java - Java 中的学生成绩程序

sql - Rails 清理事件记录查询中的用户输入

c# - Quartz.NET 的闭源替代品

java - quartz.properties 位置在 JBoss AS 7.5 中自动加载

java - quartz : daily, 仅限 9:00 至 12:00

java - IllegalAccessError : tried to access class . ..LoggingSystemProperties 来自类 ...LoggingApplicationListener

java - 使用您的 GMail 收件箱空间?

arrays - 如何取消嵌套数组以提供一系列参数?

sql - 如果事务处于 Postgresql 中的可重复读隔离级别,那么事务会看到来自另一个并发事务的插入吗?