Describe the bug
Using azure-spring-data-cosmos (7.3.0) together with spring-cloud-starter-openfeign (5.0.1) in a Spring Boot 4 application causes the application to fail at startup due to a missing Feign Encoder bean.
This happens because Feign auto-configuration relies on the presence of DataWebProperties along with Pageable. After upgrading to Spring Boot 4, DataWebProperties is no longer available in spring-data-commons (which is transitively used by azure-spring-data-cosmos), but instead resides in spring-boot-data-commons.
As a result, the Feign Encoder bean cannot be created, causing application startup failure when both libraries are used together.
A related upstream issue has been discussed in Spring Cloud OpenFeign:
Spring Cloud OpenFeign Issue #1323
However, this incompatibility still affects scenarios where azure-spring-data-cosmos is present.
Exception or Stack Trace
java.lang.IllegalStateException: No bean found of type interface feign.codec.Encoder
To Reproduce
- Create a Spring Boot 4.x application
- Add dependencies:
- azure-spring-data-cosmos:7.3.0
- spring-cloud-starter-openfeign:5.0.1
- Enable Feign clients with @EnableFeignClients
- Start the application
Code Snippet
N/A. Startup fails.
Expected behavior
Application should start successfully with both:
azure-spring-data-cosmos
spring-cloud-starter-openfeign
Feign should auto-configure an Encoder bean without requiring additional manual configuration.
Screenshots
N/A
Setup (please complete the following information):
- OS: Any
- IDE: Any
- Library/Libraries: com.azure:azure-spring-data-cosmos:7.3.0, org.springframework.cloud:spring-cloud-starter-openfeign:5.0.1
- Java version: 25
- App Server/Environment: Spring Boot Embedded Tomcat
- Frameworks: Spring Boot 4.x, Spring Cloud OpenFeign
If you suspect a dependency version mismatch (e.g. you see NoClassDefFoundError, NoSuchMethodError or similar), please check out Troubleshoot dependency version conflict article first. If it doesn't provide solution for the problem, please provide:
- verbose dependency tree (
mvn dependency:tree -Dverbose)
- exception message, full stack trace, and any available logs
Additional context
This issue only appears when both libraries are used together
It blocks application startup completely
Possible workarounds (for reference):
Manually defining a custom Encoder bean
Adding explicit dependency on spring-boot-data-commons
However, these are workarounds and not ideal for production setups.
Ideally, azure-spring-data-cosmos should align with Spring Boot 4 dependency expectations or provide compatibility guidance.
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
Describe the bug
Using azure-spring-data-cosmos (7.3.0) together with spring-cloud-starter-openfeign (5.0.1) in a Spring Boot 4 application causes the application to fail at startup due to a missing Feign Encoder bean.
This happens because Feign auto-configuration relies on the presence of DataWebProperties along with Pageable. After upgrading to Spring Boot 4, DataWebProperties is no longer available in spring-data-commons (which is transitively used by azure-spring-data-cosmos), but instead resides in spring-boot-data-commons.
As a result, the Feign Encoder bean cannot be created, causing application startup failure when both libraries are used together.
A related upstream issue has been discussed in Spring Cloud OpenFeign:
Spring Cloud OpenFeign Issue #1323
However, this incompatibility still affects scenarios where azure-spring-data-cosmos is present.
Exception or Stack Trace
java.lang.IllegalStateException: No bean found of type interface feign.codec.Encoder
To Reproduce
Code Snippet
N/A. Startup fails.
Expected behavior
Application should start successfully with both:
azure-spring-data-cosmos
spring-cloud-starter-openfeign
Feign should auto-configure an Encoder bean without requiring additional manual configuration.
Screenshots
N/A
Setup (please complete the following information):
If you suspect a dependency version mismatch (e.g. you see
NoClassDefFoundError,NoSuchMethodErroror similar), please check out Troubleshoot dependency version conflict article first. If it doesn't provide solution for the problem, please provide:mvn dependency:tree -Dverbose)Additional context
This issue only appears when both libraries are used together
It blocks application startup completely
Possible workarounds (for reference):
Manually defining a custom Encoder bean
Adding explicit dependency on spring-boot-data-commons
However, these are workarounds and not ideal for production setups.
Ideally, azure-spring-data-cosmos should align with Spring Boot 4 dependency expectations or provide compatibility guidance.
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report