When updating from Spring Boot 2.4.2 to 2.4.3 in a project that uses Liquibase and a MySQL database, I encountered a problem where the updated application can't start the ApplicationContext. The stacktrace contains the following root cause:
Caused by: 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')
at liquibase.changelog.StandardChangeLogHistoryService.getRanChangeSets(StandardChangeLogHistoryService.java:328)
at liquibase.changelog.AbstractChangeLogHistoryService.upgradeChecksums(AbstractChangeLogHistoryService.java:66)
at liquibase.changelog.StandardChangeLogHistoryService.upgradeChecksums(StandardChangeLogHistoryService.java:297)
at liquibase.Liquibase.checkLiquibaseTables(Liquibase.java:1174)
at liquibase.Liquibase.update(Liquibase.java:192)
at liquibase.Liquibase.update(Liquibase.java:178)
at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:368)
at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:316)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1845)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1782)
... 52 common frames omitted
I observed the following things that might be of interest:
- The Liquibase version didn't change by updating the Spring Boot version (which matches my expectations after reading the 2.4.3 release notes)
- The problem only exists when the liquibase changelog was applied using the old version before (that's also the reason our tests didn't catch that). If you start with an empty database, the new version works fine.
I'm not sure where to look for the problem. Since the liquibase version didn't change, I can imagine that it is a problem with incompatible versions of other dependencies.
Comment From: wilkinsona
This is a duplicate of #25401 and https://github.com/spring-projects/spring-boot/issues/24920#issuecomment-768225889.