我想與春天開機運行集成測試,並收到以下錯誤:SchedulerFactory是否可以在啓動時爲石英創建表格?
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
表沒有創建。我可以手動創建它們,但它是真的,彈簧引導是不是能夠創建它們時,他們不存在?如果是這樣的話,看起來非常平庸,因爲這些表只需要在啓動時創建一次,像create if not exisit
這樣的sql語句就足夠了。那麼春季開機會自動創建QRTZ
表嗎?
錯誤消息說沒有名爲QRTZ_LOCKS的表。你說「'QRTZ'表沒有被創建」;你的意思是說有代碼在拋出這個異常的代碼之前創建QRTZ_LOCKS表? – arcy
'有一個代碼可以創建...'是的,問題就在於此。該代碼是否存在? – Cherry