我将定时任务中改动了一个类的路径,结果服务器起来的时候出现这样的错误
org.springframework.context.ApplicationContextException: Failed to start bean ‘scheduler’; nested exception is org.springframework.scheduling.SchedulingException: Could not start Quartz Scheduler; nested exception is org.quartz.SchedulerConfigException: Failure occured during job recovery. [See nested exception: org.quartz.JobPersistenceException: Couldn’t store trigger ‘fontal.tbcgqsj’ for ‘fontal.tbcgqsj’ job:com.dzmsoft.fontal.worker.dto.ScheduleJob [See nested exception: java.lang.ClassNotFoundException: com.dzmsoft.fontal.worker.dto.ScheduleJob]]
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:176)
at org.springframework.context.support.DefaultLifecycleProcessor.access200(DefaultLifecycleProcessor.java:51)atorg.springframework.context.support.DefaultLifecycleProcessor200(DefaultLifecycleProcessor.java:51) at org.springframework.context.support.DefaultLifecycleProcessor200(DefaultLifecycleProcessor.java:51)atorg.springframework.context.support.DefaultLifecycleProcessorLifecycleGroup.start(DefaultLifecycleProcessor.java:346)
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:149)
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:112)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:852)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:782)
at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424)
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:774)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:172)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
at org.eclipse.jetty.server.Server.doStart(Server.java:282)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at com.dzmsoft.fontal.web.test.QuickStartServer.main(QuickStartServer.java:29)
Caused by: org.springframework.scheduling.SchedulingException: Could not start Quartz Scheduler; nested exception is org.quartz.SchedulerConfigException: Failure occured during job recovery. [See nested exception: org.quartz.JobPersistenceException: Couldn’t store trigger ‘fontal.tbcgqsj’ for ‘fontal.tbcgqsj’ job:com.dzmsoft.fontal.worker.dto.ScheduleJob [See nested exception: java.lang.ClassNotFoundException: com.dzmsoft.fontal.worker.dto.ScheduleJob]]
at org.springframework.scheduling.quartz.SchedulerFactoryBean.start(SchedulerFactoryBean.java:718)
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:173)
… 24 more
Caused by: org.quartz.SchedulerConfigException: Failure occured during job recovery. [See nested exception: org.quartz.JobPersistenceException: Couldn’t store trigger ‘fontal.tbcgqsj’ for ‘fontal.tbcgqsj’ job:com.dzmsoft.fontal.worker.dto.ScheduleJob [See nested exception: java.lang.ClassNotFoundException: com.dzmsoft.fontal.worker.dto.ScheduleJob]]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.schedulerStarted(JobStoreSupport.java:692)
at org.quartz.core.QuartzScheduler.start(QuartzScheduler.java:567)
at org.quartz.impl.StdScheduler.start(StdScheduler.java:142)
at org.springframework.scheduling.quartz.SchedulerFactoryBean.startScheduler(SchedulerFactoryBean.java:648)
at org.springframework.scheduling.quartz.SchedulerFactoryBean.start(SchedulerFactoryBean.java:715)
… 25 more
Caused by: org.quartz.JobPersistenceException: Couldn’t store trigger ‘fontal.tbcgqsj’ for ‘fontal.tbcgqsj’ job:com.dzmsoft.fontal.worker.dto.ScheduleJob [See nested exception: java.lang.ClassNotFoundException: com.dzmsoft.fontal.worker.dto.ScheduleJob]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.storeTrigger(JobStoreSupport.java:1223)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.doUpdateOfMisfiredTrigger(JobStoreSupport.java:1037)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.recoverMisfiredJobs(JobStoreSupport.java:986)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.recoverJobs(JobStoreSupport.java:866)
at org.quartz.impl.jdbcjobstore.JobStoreSupport1.executeVoid(JobStoreSupport.java:838)atorg.quartz.impl.jdbcjobstore.JobStoreSupport1.executeVoid(JobStoreSupport.java:838) at org.quartz.impl.jdbcjobstore.JobStoreSupport1.executeVoid(JobStoreSupport.java:838)atorg.quartz.impl.jdbcjobstore.JobStoreSupportVoidTransactionCallback.execute(JobStoreSupport.java:3703)
at org.quartz.impl.jdbcjobstore.JobStoreSupport$VoidTransactionCallback.execute(JobStoreSupport.java:3701)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3787)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.recoverJobs(JobStoreSupport.java:834)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.schedulerStarted(JobStoreSupport.java:690)
… 29 more
Caused by: java.lang.ClassNotFoundException: com.dzmsoft.fontal.worker.dto.ScheduleJob
从上面的日志可以看出com.dzmsoft.fontal.worker.dto.ScheduleJob这个是我以前的类路径,现在调整了位置,结果quartz就不认识,工程里面肯定不会有问题,那么推测只能出现在数据库层面。
查看qrtz_job_details
1
从BLOB中提取内容如下图所示,也就是说他吧一些东西记录在数据库中持久化了。
2
我至少删掉这些数据,再重新搞了。
delete from qrtz_cron_triggers;
delete from qrtz_triggers;
delete from qrtz_job_details;