Upgrading to Jackson 2.0 from 1.9 in Jersey not working

前端 未结 4 1096
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-05 08:09

I\'m using Jackson (in Jersey) to serialize entities, and I\'m migrating from Jackson 1.9 to 2.0. I followed this guide, and at first it seemed like everything worked out ea

4条回答
  •  渐次进展
    2021-01-05 08:42

    I'm answering my own question, based on the (useful) answers from StaxMan and pgelinas.

    I had to do two things to make it work.

    The first things was to remove the com.sun.jersey.api.json.POJOMappingFeature from my web.xml.

    The second was to update my jackson-jaxrs-json-provider (actually, all of my Jackson artifacts) to 2.1.

    With 2.1 or 2.0, and POJOMappingFeature, Jackson 1.9 was still being used for serialization.

    With 2.0, and POJOMappingFeature removed, I got a missing message body writer error.

    With 2.1 and POJOMappingFeature removed, everything worked as expected.

提交回复
热议问题