我在执行下面的代码时遇到com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No value type configured for ObjectReader问题
杰克逊版本是jackson-databind-2.9.9.jar
public <T> T parsingData(String body) {
try {
return getObjectMapper().reader().readValue(body);
} catch (IOException ioe) {
ioe.printStackTrace();
}
}
在我进入的确切异常下方printStackTrace,可以找到String body异常中公开的内容。
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No value type configured for ObjectReader
at [Source: (String)"{
"timestamp": "2019-06-04T09:36:50.086+02:00",
"path": "/api/check/85358/checking/246syb-f3f2-4756-91da-dae3e8ce774b/test/22462da-c4e2-45ca-bd27-246/rows/8bc3965a-ae22-4d7f-b770-262sgs24/port",
"status": 400,
"error": "Internal Server Error",
"message": "[owner.firstName2:size:1:30, owner.lastName2:size:1:30]",
"errorCode": 200000
}
"; line: 1, column: 1]
更新:您能解释一下为什么我会收到此异常吗?这是因为我没有提供Class还是TypeReference?
翻阅古今
相关分类