I am trying to use Spring websockets with Genson
instead of Jackson
. When I try and connect from a client I get the following:
java.lang.IllegalStateException: A SockJsMessageCodec is required but not available: Add Jackson 2 to the classpath, or configure a custom SockJsMessageCodec.
It would appear I need to set a custom message codec.
I can see that a .setMessageCodec
method appears on the TransportHandlingSockJsService
but I can't see anywhere in the configuration options where I can actually set it.
I think the the .setMessageCodec
method should be present on the SockJsServiceRegistration
class so it can be set from configuration...but it isn't...any ideas?
EDIT: I believe this is a bug so have raised: https://jira.spring.io/browse/SPR-12091