-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Open
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancementA general enhancement
Milestone
Description
Currently, the Jaxb2RootElementHttpMessageConverter is auto-detected by HttpMessageConverters when the registerDefaults() option is enabled (as it's always the case for the MVC infrastructure).
We received consistent feedback, saying that:
- classpath detection is not really useful because
jakarta.xml.bind.Binderis often brought transitively at runtime (for example, hibernate-core) - the nature of that message converter requires extensive runtime checks to know whether it should be used
As a result, we should disable its auto-detection and let users register it manually if they intend to use it in their applications.
In a typical Spring application, this is as a easy as:
@Configuration(proxyBeanMethods = false)
class JaxbConverterConfiguration implements WebMvcConfigurer {
@Override
public void configureMessageConverters(HttpMessageConverters.ServerBuilder builder) {
builder.withXmlConverter(new Jaxb2RootElementHttpMessageConverter());
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancementA general enhancement