我正在尝试使用 spring boot 运行集成测试并收到以下错误:
Caused by: org.springframework.context.ApplicationContextException:
Failed to start bean 'SchedulerFactory'; 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 UPDLOCK WHERE LOCK_NAME = ? [42102-193] [See nested exception: org.h2.jdbc.JdbcSQLException: Table "QRTZ_LOCKS" not found; SQL statement:
SELECT * FROM QRTZ_LOCKS UPDLOCK WHERE LOCK_NAME = ? [42102-193]]]
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:176)
很明显,QRTZ
没有创建表。我可以手动创建它们,但是当它们不存在时,spring boot 是否真的无法创建它们?如果是这样,看起来很奇怪,因为这些表只需要在启动时创建一次,并且像 sql 语句create if not exisit
就足够了。那么spring boot可以自动创建QRTZ
表吗?