Skip to content

[FEATURE REQ] Support for new spring boot 4.0.0 #47347

@JoanaPedrosoDiconium

Description

@JoanaPedrosoDiconium

Today the new version of Spring Boot was released, version 4.0.0. I tried updating it but when I boot my app, I get this error

13:57:25.344 [main] ERROR org.springframework.boot.SpringApplication -- Application run failed
java.lang.IllegalArgumentException: Unable to instantiate factory class [com.azure.spring.cloud.autoconfigure.implementation.keyvault.environment.KeyVaultEnvironmentPostProcessor] for factory type [org.springframework.boot.env.EnvironmentPostProcessor]
	at org.springframework.core.io.support.SpringFactoriesLoader$FailureHandler.lambda$throwing$0(SpringFactoriesLoader.java:632)
	at org.springframework.core.io.support.SpringFactoriesLoader$FailureHandler.lambda$handleMessage$0(SpringFactoriesLoader.java:656)
	at org.springframework.core.io.support.SpringFactoriesLoader.instantiateFactory(SpringFactoriesLoader.java:225)
	at org.springframework.core.io.support.SpringFactoriesLoader.load(SpringFactoriesLoader.java:201)
	at org.springframework.core.io.support.SpringFactoriesLoader.load(SpringFactoriesLoader.java:157)
	at org.springframework.boot.support.SpringFactoriesEnvironmentPostProcessorsFactory.loadDeprecatedPostProcessors(SpringFactoriesEnvironmentPostProcessorsFactory.java:64)
	at org.springframework.boot.support.SpringFactoriesEnvironmentPostProcessorsFactory.getEnvironmentPostProcessors(SpringFactoriesEnvironmentPostProcessorsFactory.java:56)
	at org.springframework.boot.support.EnvironmentPostProcessorApplicationListener.getEnvironmentPostProcessors(EnvironmentPostProcessorApplicationListener.java:155)
	at org.springframework.boot.support.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:131)
	at org.springframework.boot.support.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:118)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:180)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:173)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:151)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:133)
	at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:137)
	at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:82)
	at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$0(SpringApplicationRunListeners.java:66)
	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
	at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:123)
	at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117)
	at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:65)
	at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:356)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1374)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1363)
	at com.vw.ude.dataingest.Application.main(Application.java:24)
Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/ConfigurableBootstrapContext
	at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3551)
	at java.base/java.lang.Class.getConstructors(Class.java:2229)
	at org.springframework.core.io.support.SpringFactoriesLoader$FactoryInstantiator.findConstructor(SpringFactoriesLoader.java:400)
	at org.springframework.core.io.support.SpringFactoriesLoader$FactoryInstantiator.forClass(SpringFactoriesLoader.java:390)
	at org.springframework.core.io.support.SpringFactoriesLoader.instantiateFactory(SpringFactoriesLoader.java:221)
	... 23 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.ConfigurableBootstrapContext
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
	... 29 common frames omitted

Process finished with exit code 1

I have the following azure spring dependencies:

  <properties>
            <azure-sdk.version>1.2.2</azure-sdk.version>
            <azure-spring.version>6.0.0</azure-spring.version>
  </properties>

 <dependency>
        <groupId>com.azure.spring</groupId>
        <artifactId>spring-cloud-azure-starter-keyvault</artifactId>
    </dependency>

  <dependency>
      <groupId>com.azure.spring</groupId>
      <artifactId>spring-cloud-azure-starter-active-directory</artifactId>
  </dependency>

    <dependency>
            <groupId>com.azure.spring</groupId>
            <artifactId>spring-cloud-azure-starter-storage-blob</artifactId>
     </dependency>
    

Those are using azure-spring version 6.0.0.

I also have the following ones needed for integration with Azure:

    <dependency>
        <groupId>com.azure.spring</groupId>
        <artifactId>spring-cloud-azure-dependencies</artifactId>
        <version>${azure-spring.version}</version>
        <type>pom</type>
        <scope>import</scope>
    </dependency>

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-dependencies</artifactId>
        <version>${spring-cloud.version}</version>
        <type>pom</type>
        <scope>import</scope>
    </dependency>

    <dependency>
        <groupId>com.azure</groupId>
        <artifactId>azure-communication-email</artifactId>
        <version>1.1.1</version>
    </dependency>

I think the error in particular is coming from spring-cloud-azure-starter-keyvault and on Spring Boot migration guide I found no advice about migrating Azure related dependencies: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-4.0-Migration-Guide

I consulted the spring versions map https://github.com/Azure/azure-sdk-for-java/wiki/Spring-Versions-Mapping and I see none for the Spring Boot 4.0.0

Is Azure planning to launch a new version soon with additional support for this version of Spring Boot?

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.azure-springAll azure-spring related issuescustomer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions