Skip to content

[BUG][Cosmos] azure-spring-data-cosmos 7.3.0 fails with OpenFeign 5.0.1 on Spring Boot 4 – No bean found of type feign.codec.Encoder #49441

@anascec

Description

@anascec

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

  1. Create a Spring Boot 4.x application
  2. Add dependencies:
    • azure-spring-data-cosmos:7.3.0
    • spring-cloud-starter-openfeign:5.0.1
  3. Enable Feign clients with @EnableFeignClients
  4. 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

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added

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.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No fields configured for Bug.

Projects

Status
In Progress

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions