Custom Jackson ObjectMapper in Jersey 2 with Spring

三世轮回 提交于 2019-12-05 02:26:52

After further attempts, it turned out the @Component on the ObjectMapperContextResolver was causing Jersey 2.x to not use the provider even if it was explicitly registered in Jersey configuration class. This is the opposite of Jersey 1.x behaviour, where the @Component was needed.

Removing it did the trick, as odd it may seems. The @Autowired SpringObjectMapper in ObjectMapperContextResolver was still injected by Jersey.

From jersey docs i wasn't able to tell if this is by design or if this is a bug.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!