提供IllegalArgumentException的飞行路线架构

时间:2019-04-19 12:09:31

标签: java spring-boot flyway

在运行的flyway模式上,我收到此异常。使用带有弹簧启动的Java 8。

Flyway无法初始化。

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No enum constant org.flywaydb.core.api.MigrationType.
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1634)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: java.lang.IllegalArgumentException: No enum constant org.flywaydb.core.api.MigrationType.

2 个答案:

答案 0 :(得分:1)

检查flyway_schema_history表,您将看到您有一个installed_rank值设置为0的条目,删除该行并再次运行您的应用程序。这样可以解决问题。

答案 1 :(得分:0)

您还可以执行以下操作: DELETE FROM flyway_schema_history WHERE TYPE = 'DELETE'