You need to register JacksonFeature in your application if you want to use Jackson as your JSON provider (by registering this function, you will disable MOXy as your JSON provider).
You can do this either in a subclass of Application :
public class MyApplication extends Application { public Set<Class<?>> getClasses() { final Set<Class<?>> classes = new HashSet<Class<?>>();
or in ResourceConfig :
final Application application = new ResourceConfig() .packages("org.glassfish.jersey.examples.jackson") .register(MyObjectMapperProvider.class) // No need to register this provider if no special configuration is required. // Register JacksonFeature. .register(JacksonFeature.class);
See the Jackson Section in the Jersey User Guide for more information.
Michal gajdos
source share