With this addiction
<dependency> <groupId>com.fasterxml.jackson.jaxrs</groupId> <artifactId>jackson-jaxrs-json-provider</artifactId> <version>2.6.0</version> </dependency>
You still need to register a provider. You can register it individually
<init-param> <param-name>jersey.config.server.provider.classnames</param-name> <param-value> com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider </param-value> </init-param>
Or, since the dependency also comes with Jackson ExceptionMappers, you may need to simply scan the entire package (just add it to the package list)
<init-param> <param-name>jersey.config.server.provider.packages</param-name> <param-value> com.example, com.fasterxml.jackson.jaxrs.json </param-value> </init-param>
Another option, in addition to using the above dependency, is to use a Jersey โwrapperโ dependency (which handles vendor registration, among a couple of other things like Jackson Filter Filtering . Only used
<dependency> <groupId>org.glassfish.jersey.media</groupId> <artifactId>jersey-media-json-jackson</artifactId> </dependency>
With this dependency registration is required. It is automatically registered through a function with automatic detection
source share