Skip to content
Advertisement

flyway schema giving IllegalArgumentException

On running flyway schema I’m receiving this exception.using Java 8 with spring boot.

Flyway is not able to initialize.

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.

Advertisement

Answer

Check the flyway_schema_history table, there you will see that you have an entry with installed_rank value set to 0, delete the row and run your application again. This will sort the issue out.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement