@JsonCreator and mixin via Module not working for 3rd Party Class

前端 未结 1 1437
深忆病人
深忆病人 2021-01-14 09:46

I am trying to deserialize java.net.HttpCookie which doesn\'t have a default no-arg constructor and am getting: org.codehaus.jackson.map.JsonMappingException: No suitabl

相关标签:
1条回答
  • 2021-01-14 10:22

    I solved this issue, the problem was that I had defined the mixin as a non-static inner class inside of the class in which it was used. Moving it and the module to their own class definitions in their own package fixed this. One could alternatively mark the mixin inner classes as "static" to fix the issue.

    Credit to Jackson Mixin not working for deserializing non-default constructor object wherein the author made a comment on the necessity of this while posting his own question.

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