I just simply upgrade my spring boot version from 2.6.1 to 2.6.2 then my application failed to start. 2.6.1 is working fine. In my app spring-boot-starter-data-jpa & derby are in using.

I got the error:


APPLICATION FAILED TO START


Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

org.springframework.boot.sql.init.dependency.AnnotationDependsOnDatabaseInitializationDetector.detect(AnnotationDependsOnDatabaseInitializationDetector.java:36)

The following method did not exist:

org.springframework.beans.factory.config.ConfigurableListableBeanFactory.findAnnotationOnBean(Ljava/lang/String;Ljava/lang/Class;Z)Ljava/lang/annotation/Annotation;

The calling method's class, org.springframework.boot.sql.init.dependency.AnnotationDependsOnDatabaseInitializationDetector, was loaded from the following location:

jar:file:/C:/Users/jinlong/.m2/repository/org/springframework/boot/spring-boot/2.6.2/spring-boot-2.6.2.jar!/org/springframework/boot/sql/init/dependency/AnnotationDependsOnDatabaseInitializationDetector.class

The called method's class, org.springframework.beans.factory.config.ConfigurableListableBeanFactory, is available from the following locations:

jar:file:/C:/Users/jinlong/.m2/repository/org/springframework/spring-beans/5.3.13/spring-beans-5.3.13.jar!/org/springframework/beans/factory/config/ConfigurableListableBeanFactory.class

The called method's class hierarchy was loaded from the following locations:

org.springframework.beans.factory.config.ConfigurableListableBeanFactory: file:/C:/Users/jinlong/.m2/repository/org/springframework/spring-beans/5.3.13/spring-beans-5.3.13.jar

Action:

Correct the classpath of your application so that it contains compatible versions of the classes org.springframework.boot.sql.init.dependency.AnnotationDependsOnDatabaseInitializationDetector and org.springframework.beans.factory.config.ConfigurableListableBeanFactory

Comment From: snicoll

I just simply upgrade my spring boot version from 2.6.1 to 2.6.2

I don't think that is accurate. Spring Boot 2.6.2 uses Spring Framework 5.3.14 and your application uses 5.3.13. That's also the root cause of the problem as a method has been added in 5.3.14 that this class uses. Using our dependency management and avoiding to override versions like you do is our recommendation to avoid those problems.