提问者:小点点

Spring-石英-天桥项目,天桥不工作


我试图在h2上创建Spring石英飞道,但失败了。

15:58:09.941 [main] ERROR org.springframework.boot.SpringApplication - Application startup failed
org.springframework.context.ApplicationContextException: Failed to start bean 'schedulerFactoryBean'; 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.impl.jdbcjobstore.LockException: Failure obtaining db row lock: Table   "QRTZ_LOCKS" not found; SQL statement:
 SELECT * FROM QRTZ_LOCKS WHERE SCHED_NAME = 'schedulerFactoryBean' AND LOCK_NAME = ? FOR UPDATE [42102-193] [See nested exception: org.h2.jdbc.JdbcSQLException: Table "QRTZ_LOCKS" not found; SQL statement:

这是我的属性文件:

internal.profile=test
    server.port=8080
------
quartz.properties=quartz-inmemory.properties
management.security.enabled=false
flyway.enabled=true
flyway.baseline-version=1
flyway.init-sqls=db/migration/V2_init.sql
flyway.locations=db/migration/V2_init.sql
spring.jpa.hibernate.ddl-auto=validate
spring.h2.console.enabled=true
flyway.baselineOnMigrate = true
#============================================================================
# Configure Main Scheduler Properties
#============================================================================
org.quartz.scheduler.instanceName = InMemoryScheduler
org.quartz.scheduler.instanceId = AUTO


#============================================================================
# Configure ThreadPool
#============================================================================
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 25
org.quartz.threadPool.threadPriority = 5


#============================================================================
# Configure JobStore
#============================================================================
org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore

这是我的日程安排:

@Bean
public SchedulerFactoryBean schedulerFactoryBean(       @Qualifier("quartzDataSource") DataSource dataSource, JobFactory jobFactory
) throws IOException {
SchedulerFactoryBean factory = new SchedulerFactoryBean();
factory.setOverwriteExistingJobs(true);
factory.setDataSource(dataSource);
factory.setJobFactory(jobFactory);
factory.setQuartzProperties(quartzProperties());
return factory;
} 

请注意,每当我尝试在mysql实例上做事时,我所有的调度程序配置都可以正常工作,但是在我的sql上我失败了


共1个答案

匿名用户

我通过将文件名更改为 R2_2_init.sql来修复它