I upgraded a Spring Boot application to Spring Boot 4.0.0 with Java 25 LTS, and I am using:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>spring-cloud-gcp-starter-secretmanager</artifactId>
<version>7.3.2</version>
</dependency>
When the application starts, it fails with:
java.lang.NoSuchMethodError:
'org.springframework.boot.ConfigurableBootstrapContext
org.springframework.boot.context.config.ConfigDataLocationResolverContext.getBootstrapContext()'
at com.google.cloud.spring.autoconfigure.secretmanager.SecretManagerConfigDataLocationResolver.registerBean(...)
It looks like Spring Cloud GCP is calling a method that no longer exists in Spring Boot 4.
Is Spring Cloud GCP 7.x compatible with Spring Boot 4.0.0?
This works with Spring Boot 4.0.3:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>spring-cloud-gcp-dependencies</artifactId>
<version>8.0.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
After aligning the Spring Cloud GCP BOM to 8.0.1, the application runs smoothly.
this my complete notes for migration Spring Boot 3.5.* to Spring Boot 4.0.3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With