LiquibaseException java.lang.ClassCastException: class java.time.LocalDateTime cannot be cast to class java.lang.String

Hello,

we are getting error with last version to mysql-connector-java (8.0.23) and liquibase(4.3.0), when we start the spring boot application. The error started when we updated mysql-connector-java (8.0.22) to mysql-connector-java (8.0.23). Looks like error with DATABASECHANGELOG table, DATEEXECUTED field.

nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘liquibase’ defined in class path resource [org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration$LiquibaseConfiguration.class]: Invocation of init method failed; nested exception is liquibase.exception.LiquibaseException: java.lang.ClassCastException: class java.time.LocalDateTime cannot be cast to class java.lang.String (java.time.LocalDateTime and java.lang.String are in module java.base of loader ‘bootstrap’)

We have the same problem. And it’s even more interesting because if you run your change log file first time everything is great. But after databasechangelog table created it stops working.
Have you find a solution?

Hello,

found solution switching to liquibase 4.3.1 version.

Thanks a lot. It’s worked out for me as well. I guess it was kind of a bug.

1 Like