org.springframework.http.converter.HttpMessageNotWritableException: Could not write content: (was java.lang.NullPointerException) (through reference chain: com.smart.dao.Page["content"]->java.util.Collections$UnmodifiableRandomAccessList[3]->com.smart.model.coupon.Coupon["title"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: (was java.lang.NullPointerException) (through reference chain: com.smart.dao.Page["content"]->java.util.Collections$UnmodifiableRandomAccessList[3]->com.smart.model.coupon.Coupon["title"])
在实体中有:
public String getTitle() {
if(CouponType.DEDUCT_FEE.equals(type)) {return name + "面值" + faceValue.longValue() + "元";
}
else {
return name + "面值" + faceValue.floatValue() + "%";
}
}
而在数据库中存在:type=null 的数据
把数据删掉吧.