[
https://issues.apache.org/jira/browse/CXF-2514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chaitanya Choleti updated CXF-2514:
-----------------------------------
Attachment: sources.zip
json_test.war
The sources and the war application are attached.
> Custom ContextResolver is not picked up for marshal/unmarshal calls for
> application/json and application/xml media types.
> -------------------------------------------------------------------------------------------------------------------------
>
> Key: CXF-2514
> URL: https://issues.apache.org/jira/browse/CXF-2514
> Project: CXF
> Issue Type: Bug
> Components: JAX-RS
> Affects Versions: 2.2.4
> Environment: Windows, jdk1.5.0_06
> Reporter: Chaitanya Choleti
> Attachments: json_test.war, sources.zip
>
>
> In the method
> org.apache.cxf.jaxrs.provider.AbstractJAXBProvider.getJAXBContext(Class<?>
> type, Type genericType)
> ContextResolver<JAXBContext> resolver =
> mc.getResolver(ContextResolver.class, JAXBContext.class);
> getResolver(...) always returns null.
>
> This happens because in
> org.apache.cxf.jaxrs.utils.JAXRSUtils.createContextResolver(Type genericType,
> Message m) method there is a check (genericType instanceof ParameterizedType)
> in this case genericType is JAXBContext.class which is not an instance of
> ParameterizedType so the check fails and a null value is returned.
>
> Suggested Fix : Inject the context resolver directly in to
> AbstractJAXBProvider as it was done in an earlier version.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.