-2
I am trying to add new fields to my table in my Spring Boot project using Flyway, and I am not getting this error message.
2020-04-29 12:53:36.345 WARN 544 --- [ restartedMain]
ConfigServletWebServerApplicationContext : Exception encountered
during context initialization - cancelling refresh attempt:
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
org.flywaydb.core.api.FlywayException: Validate failed: Migration
checksum mismatch for migration version 02
-> Applied to database : 0
-> Resolved locally : -1105036925
2020-04-29 12:53:36.346 INFO 544 --- [ restartedMain]
com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown
initiated... 2020-04-29 12:53:36.347 INFO 544 --- [ restartedMain]
com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown
completed. 2020-04-29 12:53:36.350 INFO 544 --- [ restartedMain]
o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2020-04-29 12:53:36.359 INFO 544 --- [ restartedMain]
ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report
re-run your application with 'debug' enabled. 2020-04-29 12:53:36.366
ERROR 544 --- [ restartedMain] o.s.boot.SpringApplication
: Application run failed
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
org.flywaydb.core.api.FlywayException: Validate failed: Migration
checksum mismatch for migration version 02
-> Applied to database : 0
-> Resolved locally : -1105036925
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796)
~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE] at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595)
~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE] at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE] at
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE] at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE] at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE] at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE] at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310)
~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE] at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE] at
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1108)
~[spring-context-5.2.5.RELEASE.jar:5.2.5.RELEASE] at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:868)
~[spring-context-5.2.5.RELEASE.jar:5.2.5.RELEASE] at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
~[spring-context-5.2.5.RELEASE.jar:5.2.5.RELEASE] at
org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
~[spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE] at
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
[spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE] at
org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
[spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE] at
org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
[spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE] at
org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
[spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE] at
org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
[spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE] at
com.server.agenda.AgendaApplication.main(AgendaApplication.java:10)
[classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method) ~[na:1.8.0_241] at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
~[na:1.8.0_241] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
~[na:1.8.0_241] at java.lang.reflect.Method.invoke(Unknown Source)
~[na:1.8.0_241] at
org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
[spring-boot-devtools-2.2.6.RELEASE.jar:2.2.6.RELEASE] Caused by:
org.flywaydb.core.api.FlywayException: Validate failed: Migration
checksum mismatch for migration version 02
-> Applied to database : 0
-> Resolved locally : -1105036925
at org.flywaydb.core.Flyway.doValidate(Flyway.java:275)
~[flyway-core-6.0.8.jar:na] at
org.flywaydb.core.Flyway.access$100(Flyway.java:79)
~[flyway-core-6.0.8.jar:na] at
org.flywaydb.core.Flyway$1.execute(Flyway.java:157)
~[flyway-core-6.0.8.jar:na] at
org.flywaydb.core.Flyway$1.execute(Flyway.java:149)
~[flyway-core-6.0.8.jar:na] at
org.flywaydb.core.Flyway.execute(Flyway.java:511)
~[flyway-core-6.0.8.jar:na] at
org.flywaydb.core.Flyway.migrate(Flyway.java:149)
~[flyway-core-6.0.8.jar:na] at
org.springframework.boot.autoconfigure.flyway.FlywayMigrationInitializer.afterPropertiesSet(FlywayMigrationInitializer.java:65)
~[spring-boot-autoconfigure-2.2.6.RELEASE.jar:2.2.6.RELEASE] at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1855)
~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE] at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1792)
~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE] ... 23 common frames
omitted
The project structure is correct, the files are named correct, the sql script is also right, do not know where the problem is, note.
My database is the Postgre
When asking a question, always ask the whole question. Replying to your follow-up complicates the visualization of anyone who can help you
– Clayton Tosatti