Jackson Json and no such method errors

后端 未结 1 947
醉话见心
醉话见心 2020-12-16 09:30

I am trying to use jackson to serialize and deserialize a POJO. Going from POJO to JSON works perfectly but going the other direction does not.

I have a POJO

相关标签:
1条回答
  • 2020-12-16 09:42

    It looks like the problem is that you are getting incompatible versions of jackson-core and jackson-databind - jackson-core 2.0.5 is being pulled in, but I believe at least 2.1.0 is required.

    The first line of the exception tells you that it can't find the method JsonParser.getValueAsString(), looking at the API docs for 2.0.5, that method indeed does not exist. It looks like it was added in 2.1.0.

    So, you'll need to fix the dependencies - most likely by excluding 2.0.5 and including 2.1.0.

    0 讨论(0)
提交回复
热议问题