You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Chaitanya Choleti (JIRA)" <ji...@apache.org> on 2009/11/02 08:34:59 UTC

[jira] Created: (CXF-2514) Custom ContextResolver is not picked up for marshal/unmarshal calls for application/json and application/xml media types.

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


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.


[jira] Updated: (CXF-2514) Custom ContextResolver is not picked up for marshal/unmarshal calls for application/json and application/xml media types.

Posted by "Chaitanya Choleti (JIRA)" <ji...@apache.org>.
     [ 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.


[jira] Resolved: (CXF-2514) Custom ContextResolver is not picked up for marshal/unmarshal calls for application/json and application/xml media types.

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Beryozkin resolved CXF-2514.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.3
                   2.2.5
         Assignee: Sergey Beryozkin

> 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
>            Assignee: Sergey Beryozkin
>             Fix For: 2.2.5, 2.3
>
>         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.