Thanks, that explains it.
Newer CXFs implement the provider selection algorithm more strictly (per the spec). Before, the user provided provider would always win. Now the selection criterias are slightly different, Jackson, as the default Jettison, are both wildcard providers, but Jettison has more specific Produces/Consumes annotations hence it wins.

The easiest way to fix it is to make sure that Jettison (or cxf-rt-rs-extension-providers module) is not included in the runtime classpath. A "skip.default.json.provider.registration" property exists to avoid registering Jettison if it it tricky to remove it from the classpath too

HTH, Sergey

On 18/04/17 16:43, Kulbhushan Azad wrote:
org.apache.cxf.jaxrs.provider.json.JSONProvider.readFrom(JSONProvider.java:242)

thats the provider i see from the Exception stacktrace

On Tue, Apr 18, 2017 at 11:32 AM, Sergey Beryozkin <[email protected]>
wrote:

No, not seeing it - how difficult it is to do a bit of an effort and check
the trace on your own ?

Thanks, Sergey
On 18/04/17 16:27, Kulbhushan Azad wrote:

attached the screenshot , see if its okay now

On Tue, Apr 18, 2017 at 11:09 AM, Sergey Beryozkin <[email protected]
<mailto:[email protected]>> wrote:

    This image is inlined and is not displayed properly, simply have a
    look at the trace and check which provider is reporting it...

    Sergey
    On 18/04/17 15:53, Kulbhushan Azad wrote:

        hi Sergey

        when i use the provider
        com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider i see
        the error.

        the earlier version of jackson(1.9.13) provider as
        org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider it does not
        give any
        error keeping everything else unchanged

        attaching below the screenshot of the error i see on the console
        , so
        not sure whats going on with this and thanks for your help

        Inline image 1

        On Tue, Apr 18, 2017 at 9:34 AM, Sergey Beryozkin
        <[email protected] <mailto:[email protected]>
        <mailto:[email protected] <mailto:[email protected]>>>
wrote:

            Is it reported by JacksonJaxbJsonProvider in response to an
            application/json payload ?

            Sergey

            On 18/04/17 06:33, Kulbhushan Azad wrote:

                hi
                i am seeing below error while running the rest request
        from postman

                JAXBException occurred : unexpected element (uri:"",
                local:"ProjectName").
                Expected elements are
                <{http:/xxx.xx.com/xxx/xxx/schema/v1}Project
<http://xxx.xx.com/xxx/xxx/schema/v1%7DProject>
        <http://xxx.xx.com/xxx/xxx/schema/v1%7DProject>
                <http://xxx.xx.com/xxx/xxx/schema/v1%7DProject
        <http://xxx.xx.com/xxx/xxx/schema/v1%7DProject>>>,<{http:/
                xxx.xx.com/xxx/xxx/schema/v1}Subproject
<http://xxx.xx.com/xxx/xxx/schema/v1%7DSubproject>
        <http://xxx.xx.com/xxx/xxx/schema/v1%7DSubproject>
                <http://xxx.xx.com/xxx/xxx/schema/v1%7DSubproject

        <http://xxx.xx.com/xxx/xxx/schema/v1%7DSubproject>>>



                my corresponding spring configuration:

                <bean id="fw.restEndpointParent"
                class="org.apache.cxf.jaxrs.JAXRSServerFactoryBean">
                        <property name="bus" ref="fw_restServerBus" />
                        <property name="extensionMappings">
                            <map>
                                <entry key="json"
        value="application/json" />
                                <entry key="xml" value="application/xml"
/>
                            </map>
                        </property>
                        <property name="providers">
                            <list>
                                <bean

        class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider"
/>
                            </list>
                        </property>

                    </bean>

                 it used to work fine with the CXF 2.7.8 and jackson
1.9.13

                Not sure what could be the issue here
                would appreciate any help or pointers with respect to this





            --
            Sergey Beryozkin

            Talend Community Coders
            http://coders.talend.com/




        --
        Thanks
        Kulbhusan





--
Thanks
Kulbhusan



--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/





Reply via email to