Skip to content

IncompatibleClassChangeError after upgrading to Spring Framework 7.0.3 (HttpHeaders & MultiValueMap) java 25 #36280

@rani111agrawal

Description

@rani111agrawal

We are facing an issue after upgrading our application from Spring Framework 6.x to 7.0.3.
This issue occurs while calling an API that is used behind AWS CloudFront.

After the upgrade, we get the following runtime error:

java.lang.IncompatibleClassChangeError:
Class org.springframework.http.HttpHeaders does not implement
the requested interface org.springframework.util.MultiValueMap
at org.springframework.http.HttpHeaders.isEmpty(HttpHeaders.java:1897)
at org.springframework.web.servlet.mvc.method.annotation.HttpEntityMethodProcessor.handleReturnValue(HttpEntityMethodProcessor.java:227)
The error happens when returning a ResponseEntity from a controller method.
public ResponseEntity postDynamicField(@RequestBody CloudFront cloudFront) {
CloudFront fetchedCloudFront = awsCFService.getSignedURL(cloudFront);
return ResponseEntity.status(HttpStatus.CREATED).body(fetchedCloudFront);
}

Could you help in resolution.

Technical Stack
Spring 7.0.3
Java 25
aws-java-sdk-cloudfront 1.12.797

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions