Skip to content

AllEncompassingFormHttpMessageConverter ignores JAXB XML when Jackson used for JSON [SPR-14336] #18908

Closed
@spring-projects-issues

Description

@spring-projects-issues

Jan Zahornadsky opened SPR-14336 and commented

After changes introduced in #17894, the new conditions are causing that in a project that uses both XML (via JAXB) and JSON (via Jackson) AllEncompassingFormHttpMessageConverter no longer works correctly with XML.

Referring to the code in https://github.com/spring-projects/spring-framework/blob/master/spring-web/src/main/java/org/springframework/http/converter/support/AllEncompassingFormHttpMessageConverter.java, the condition for including Jaxb part converter should read

// instead of && !jackson2Present
if (jaxb2Present && !jackson2XmlPresent) {
	addPartConverter(new Jaxb2RootElementHttpMessageConverter());
}

Affects: 4.2.6

Issue Links:

Referenced from: commits abcfffd, d0b2fe5

Backported to: 4.2.7

Metadata

Metadata

Assignees

Labels

status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions