Resolved [org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: (was java.lang.NullPointerException); nested exception is com.fasterxml.jackson.databind.JsonMappingException: (was java.lang.NullPointerException) (through reference chain: com.fms.http.BaseResponseJson["data"]->java.util.ArrayList[0]->com.fms.bean.FileBean["userID"])]
检查了实体类,才发现get set 方法还是基本数据类型,心累

本文探讨了一个在Spring框架中常见的异常——HttpMessageNotWritableException,具体表现为无法将Java对象序列化为JSON的问题,尤其在BaseResponseJson实体类的数据处理中遇到NullPointerException。通过检查实体类的get和set方法,发现基本数据类型的使用可能是导致这一问题的原因。

9400

被折叠的 条评论
为什么被折叠?



