MappingJackson2XmlHttpMessageConverterConfiguration and spring.xml.ignore property
See original GitHub issueI’m upgrading an application from SpringBoot2.6 to SprintBoot2.7 (2.7.4). It relies on Azure SDK for Java, which has a dependency over jackson-xml. This is discussed in https://github.com/Azure/azure-sdk-for-java/issues/7694, and one solution to workaround this is to rely on a spring.properties file holding spring.xml.ignore=true.
While this covers many cases, I have unit-tests which are still failing as XML output is produced. It appears JacksonHttpMessageConvertersConfiguration.MappingJackson2XmlHttpMessageConverterConfiguration has no exclusion relating to spring.xml.ignore=true, hence MappingJackson2XmlHttpMessageConverter is being injected into HttpMessageConverters.
There is HttpMessageConverters.reorderXmlConvertersToEnd which may help, but it covers only defaultConverters, not the input converters as provided by HttpMessageConvertersAutoConfiguration
Why JacksonHttpMessageConvertersConfiguration.MappingJackson2XmlHttpMessageConverterConfiguration isn’t excluded by spring.xml.ignore=true?
Issue Analytics
- State:
- Created a year ago
- Comments:20 (18 by maintainers)

Top Related StackOverflow Question
Why would we deprecate something that’s internal, not meant to be used externally and not documented. Let’s stop this discussion please. Brian also shared previously that “This option was never meant to be officially supported in the first place”.
@blacelle That test passes for me once I’d updated
expectedto be{'Intro to Spring Boot':'Spring team'}(a:rather than a,between the two strings). There must be something else going on in your case that you haven’t shared, such as auto-configuration of Spring MVC being disabled. Can you please provide a complete yet minimal sample that reproduces the problem? That sample should be something that we can run without any copy-paste or modifications and reproduce the problem.