Skip to content

Commit b1a3849

Browse files
committed
Disable Jackson XML support in RSocket codecs
Prior to this commit, having the `spring-boot-starter-rsocket` and the `jackson-dataformat-xml` dependencies on classpath would result in a `ClassCastException` when the RSocket auto-configuration tries to configure Jackson CBOR codecs for RSocket strategies. This commit disables the Jackson XML support for the CBOR codec in RSocket. Fixes gh-17425
1 parent 2830847 commit b1a3849

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/rsocket/RSocketStrategiesAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ protected static class JacksonCborStrategyConfiguration {
7878
@ConditionalOnBean(Jackson2ObjectMapperBuilder.class)
7979
public RSocketStrategiesCustomizer jacksonCborRSocketStrategyCustomizer(Jackson2ObjectMapperBuilder builder) {
8080
return (strategy) -> {
81-
ObjectMapper objectMapper = builder.factory(new CBORFactory()).build();
81+
ObjectMapper objectMapper = builder.createXmlMapper(false).factory(new CBORFactory()).build();
8282
strategy.decoder(new Jackson2CborDecoder(objectMapper, SUPPORTED_TYPES));
8383
strategy.encoder(new Jackson2CborEncoder(objectMapper, SUPPORTED_TYPES));
8484
};

0 commit comments

Comments
 (0)