Custom Jackson ObjectMapper in Jersey 2 with Spring Custom Jackson ObjectMapper in Jersey 2 with Spring spring spring

Custom Jackson ObjectMapper in Jersey 2 with Spring


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.