We use IBM in the Apache Wink bundle to offer JAXRS endpoints for our application. We code for Websphere 8.5.5. Since we are compatible with servlets 3.0, we use the βsoftwareβ way to configure the JaxRS application, which means there are no entries in web.xml, and we rely on class scanning for jax rs annotated resources. All in all, it works great.
@ApplicationPath("/api/v1/") public class MyApplication extends Application{
This version of Websphere, along with Apache Wink, uses Jackson 1.6.x for JSON de / serialization and generally works well. We would like to at least change some default values ββfor Object Mapper
Thus, we defined a client permission context that simply changed some se / deserialzation properties.
@Provider @Produces(MediaType.APPLICATION_JSON) public class CustomJackssonConverter implements ContextResolver<ObjectMapper> { final ObjectMapper defaultObjectMapper; public AibasJackssonConverter() { defaultObjectMapper = createDefaultMapper(); } ... mapper.getSerializationConfig().set(SerializationConfig.Feature.INDENT_OUTPUT, true);
During JAX-RS calls, we see that the container registers a new provider, without errors
The problem is that the Configuration does not βfollowβ, from the logs I can see that the Wink Engine is looking for the WinkJacksonProvider, which in turn returns JacksonProvider, which follows the default values ββof Jackson (s)
Is there any way to change this default value?
I tried to change the implementation of the application object, as indicated here, to programmatically configure the providers, but this did not work.
http://www.ibm.com/developerworks/java/library/wa-aj-jackson/index.html
Any clues or hints?
Thank you very much