Skip to content

WebSocket app fails to start when Jackson is on the classpath but there's no JsonMapper bean #49749

@dlwldnjs1009

Description

@dlwldnjs1009

In WebSocketMessagingAutoConfiguration,
JacksonWebSocketMessageConverterConfiguration is conditioned on
JsonMapper.class, but its constructor requires a JsonMapper bean.

The other nested configuration in the same file,
SpringBootWebSocketMessageBrokerConfiguration, already guards the same
dependency with @ConditionalOnBean(JsonMapper.class).

Similar patterns exist in other modules for mapper-dependent configurations,
for example:

  • CodecsAutoConfiguration
  • JacksonHttpMessageConvertersConfiguration
  • RSocketStrategiesAutoConfiguration

In practice, I realize this is unlikely to affect normal Boot usage since
JacksonAutoConfiguration will usually provide a JsonMapper bean when the
class is present.

I was wondering if this configuration should back off when the bean is absent,
so that its condition more closely matches its constructor dependency.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions