2017-03-09 61 views
0

我想創建春天石英對H2的飛行路線,我沒有春 - 石英 - 飛路項目,遷徙路線行不通

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我失敗

+0

您已閱讀flyway.init-sql語句和flyway.locations文檔固定呢?兩者都看起來不錯。您還沒有顯示任何實際上會創建顯然缺少的表的SQL。 –

回答

0

我通過更改文件的名稱R2_2_init.sql