jax rs - Jboss 7.1.1 - Jackson ContextResolver<ObjectMapper> works only on one deployment -
i have 2 rest webapps want deploy on jboss 7.1.1. server.
rest requests in both apps produces , consumes json. utilize jackson provider serialize , deserialize objects.
now, need custom objectmapper configurations each webapp. resolve problem added @provider classes implementing contextresolver. 1 each project. fe. 1 of class looks that:
@provider @produces(mediatype.application_json) @consumes(mediatype.application_json) public class jacksonconfig implements contextresolver<objectmapper> { private final objectmapper objectmapper; public jacksonconfig() { objectmapper = new objectmapper(); objectmapper.configure(serializationconfig.feature.wrap_root_value, true); } @override public objectmapper getcontext(class<?> objecttype) { homecoming objectmapper; } }
it works when deploy 1 of projects on jboss. when seek deploy both, first initialized project utilize defined objectmapper. other 1 never calls getcontext method contextresolver class. wrong?
edit!:
after lot of trials decided alter method of parsing json jackson staxon. hoped @ to the lowest degree method work well. not... serialization works on both deployed applications. again, somehow jboss decided utilize jackson instead of staxon in deserialization process. 1 time again application phone call first after deployment works well. sec 1 using jackson (no thought why...) calls exceptions. always...
is there problem jboss? i'm doing wrong have no thought where. has thought should look?
looks found solution problem. known issue of resteasy, can removed build-in option:
to solve problem had add together param web.xml of projects:
<context-param> <param-name>resteasy.use.deployment.sensitive.factory</param-name> <param-value>false</param-value> </context-param>
i found solution in resteasy jira. it's unusual me there no info in jboss or resteasy related documentation...
jackson jax-rs jboss7.x resteasy
No comments:
Post a Comment