Skip to content

Spring Framework 5.3.x is incompatible with Jetty 10 (Client) #29867

Closed
@mikebell90

Description

@mikebell90

We have recently moved to Spring Boot 2.7.5 with Jetty 10 (or are trying to).

What we found was two things - one is probably not relevant, that you have to manually manage the reactive-httpclient adapter for jetty to 2.x (would be nice if this were documented), but more importantly, the JettyHeadersAdapter class in org.spring.framework.http.client.reactive is compatible with Jetty 9 but not Jetty 10.

We received errors like :

java.lang.IncompatibleClassChangeError: Found interface org.eclipse.jetty.http.HttpFields, but class was expected
	at org.springframework.http.client.reactive.JettyHeadersAdapter.toSingleValueMap(JettyHeadersAdapter.java:86)

digging further, we find the JettyHeaderAdapter class imports org.eclipse.jetty.http.HttpFields and indeed this changed from a class in Jetty 9 to an interface in Jetty 10+.

methods such as

public void add(String key, @Nullable String value) {
		this.headers.add(key, value); // headers is an HttpFields instance
	}

fail because of this

You fixed issues for Jetty 11/12 which were identical in https://github.com/spring-projects/spring-framework/blob/d84ca2ba90d27a7c63d7b35a6259b5b9cf341118/spring-web/src/main/java/org/springframework/http/client/reactive/JettyHeadersAdapter.java

however this fix (which would be more involved because it would have to sniff for Jetty 10 and instantiate a different JettyHeadersAdapter) has not been backported.

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: feedback-providedFeedback has been providedtype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions