且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

RestEasy:org.codehaus.jackson.map.JsonMappingException:无法从START_OBJECT标记(..)中反序列化java.util.ArrayList的实例

更新时间:2022-06-05 17:09:29

这看起来像是一个Jackson错误,它期望解析一个数组(以'['开头),但它遇到一个对象的开始标记('{')。从查看你的代码,我猜它正在尝试将JSON反序列化到你的List中,但是它获得了一个对象的JSON。

That looks like a Jackson error, where it's expecting to parse an array (which would begin with a '[') but it's encountering the beginning token for an object ('{'). From looking at your code, Im guessing it's trying deserialise JSON into your List but it's getting the JSON for an object.

你的REST端点返回的JSON是什么样的?它应该看起来像这样

What does the JSON your REST endpoint returns look like? It ought to look like this

[
    {
        // JSON for VariablePresentation value 0
        "field0": <some-value>
        <etc...>
    },
    <etc...>
]