16. nested exception is com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "auditUnitName"

 org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver:handleHttpMessageNotReadable:384 -Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: Could not read document: Unrecognized field "auditUnitName" (class com.ylkj.business.auditresult.problem.pojo.dto.ProblemSaveDto), not marked as ignorable (40 known properties: "problemNo", "rectifyperiodEnd", "amountOfPreviousYear", "projectName", "isCarryOver", "institutionProblem", "rectifyperiodStart", "isReportDisclosure", "area", "itemId", "problemNoGw", "requestCompleteTime", "problemAmount", "oneLevelType", "rectifyState", "responsibleUnit", "auditedUnit", "threeLevelType", "checkType", "auditOpinion", "responsiblePerson", "policyBasis", "twoLevelType", "itemTreeLevel", "importance", "currentYearInvolvedAmount", "definitionOfResponsibility", "problemType", "matterId", "year", "isIncludeFormalOpinions", "violationReason", "professionClassify", "isDistribute", "violationNature", "questionDate", "manageReason", "manageUnit", "isRemainProblem", "remainYear"])
 at [Source: [email protected]2; line: 1, column: 936] (through reference chain: com.ylkj.business.auditresult.problem.pojo.dto.ProblemSaveDto["auditUnitName"]); nested exception is com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "auditUnitName" (class com.ylkj.business.auditresult.problem.pojo.dto.ProblemSaveDto), not marked as ignorable (40 known properties: "problemNo", "rectifyperiodEnd", "amountOfPreviousYear", "projectName", "isCarryOver", "institutionProblem", "rectifyperiodStart", "isReportDisclosure", "area", "itemId", "problemNoGw", "requestCompleteTime", "problemAmount", "oneLevelType", "rectifyState", "responsibleUnit", "auditedUnit", "threeLevelType", "checkType", "auditOpinion", "responsiblePerson", "policyBasis", "twoLevelType", "itemTreeLevel", "importance", "currentYearInvolvedAmount", "definitionOfResponsibility", "problemType", "matterId", "year", "isIncludeFormalOpinions", "violationReason", "professionClassify", "isDistribute", "violationNature", "questionDate", "manageReason", "manageUnit", "isRemainProblem", "remainYear"])
 at [Source: [email protected]; line: 1, column: 936] (through reference chain: com.ylkj.business.auditresult.problem.pojo.dto.ProblemSaveDto["auditUnitName"])

  

解决方案如下:

在需要转化的对象的类中添加注解,注解信息如下:

@JsonIgnoreProperties(ignoreUnknown = true)

原文地址:https://www.cnblogs.com/zkx4213/p/12606465.html

时间: 2024-11-05 16:11:20

16. nested exception is com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "auditUnitName"的相关文章

com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "ExceptionId"

com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "ExceptionId" (class com.tongyan.ems.model.request.SynchronizedBean), not marked as ignorable (2 known properties: "cityIds", "exceptionId"]

com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "FileSize"

请求阿里云的OSS接口图片信息,返回json格式的数据,通过ObjectMapper将json转为Image对象时候报错转换失败 将json转对象的代码: String jsonStr = "{\n" + " \"FileSize\": {\"value\": \"25929\"},\n" + " \"Format\": {\"value\": \"

JSON parse error: Cannot deserialize instance of `int` out of START_OBJECT token; nested exception is com.fasterxml.jackson.databind.exc

代码程序: @PostMapping("selectById") @ResponseBody public Result selectById(@RequestBody int id) { Result result =new Result(); List<User> list = userService.selectById(id); if(list.size()==1){ result.setCode("000"); result.setMsg(&q

org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field &quot;phoneNo&quot; ...not marked as ignorable at

2015-04-29 11:02:12.133 [http-8090-9] WARN org.jasig.cas.client.util.CommonUtils.safeGetParameter[CommonUtils:264] - safeGetParameter called on a POST HttpServletRequest for LogoutRequest. Cannot complete check safely. Reverting to standard behavior

jackson com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException

jackson 2.2.2 由于vo中缺少json的某个字段属性引起 2种解决方法 1:vo中添加注解@JsonIgnoreProperties(ignoreUnknown = true) 2.  mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);

meta对象写入json错误:com.cutt.zhiyue.android.api.io.exception.JsonFormaterException: com.fasterxml.jackson.databind.JsonMappingException

首先说明出现的原因:json这个东西不够智能,在解析javabean对象中的getter和setter方法时,会把两个方法命名十分相近的方法当成一个.从而形成异常. 解决办法:重新命名方法名. 同时需要注意:json在写入某一个meta对象时,会将其所关联的meta对象统统捋一遍(不一定是重置,可能仅仅是遍历一下). 这是我们的json写入异常: com.cutt.zhiyue.android.api.io.exception.JsonFormaterException: com.fasterx

error:com/fasterxml/jackson/databind/exc/InvalidDe

因为要给前端返回json数据,在pom文件中引入了jackson的包,启动项目的时候就一直报错 java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/exc/InvalidDefinitionException.一开始以为是缺少jackson的jar包,看了一下,基本上都有.后上网查找资源普遍都说什么包冲突,去pom.xml文件查看了,有ali仓库的fastjson和另一个json包像似重叠,最后把另一删掉,还是报上面的问题

【RabbitMQ】反序列化失败 com.fasterxml.jackson.databind.exc.MismatchedInputException

记一次RabbitMQ,使用Jackson反序列化的报错: 报错: Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `[B` out of START_OBJECT token at [Source: (String)"{"id":1,"userName":"jack","

com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class cn.edu.

详细信息   https://www.cnblogs.com/xuwenjin/p/8832522.html 解决办法: 在实体类上面加上注解 @JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" }) package cn.edu.aynu.Bean; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; im