信息 Could not read document: Can not instantiate value of type [simple type, class com.platform.entity.OrderEntity] from String value (’,’); no single-String constructor/factory method at [Source: java.io.PushbackInputStream@2aa188aa; line: 1, column: 1]; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not instantiate value of type [simple type, class com.platform.entity.OrderEntity] from String value (’,’); no single-String constructor/factory method at [Source: java.io.PushbackInputStream@2aa188aa; line: 1, column: 1]
发现后端不进debugger
一开始以为是序列化时出问题了,结果不是
经过对比发现数据中 某个字段含有一些特殊符号
前端代码:
saveOrUpdate: function (event) {
vm.shippingList = vm.shippingList.filter(e => {
return e.shippingId != null && e.shippingNo != '';
})
if(!vm.shippingList.length > 0) {
alert("请填写快递信息");
return;
}
vm.order.orderShippings = vm.shippingList;
$.ajax({
type: "POST",
url: '../order/sendGoods',
contentType: "application/json",
data: JSON.stringify(vm.order),
success: function (r) {
if (r.code === 0) {
alert('操作成功', function (index) {
vm.reload();
});
} else {
var data = JSON.parse(r);
alert(data.msg);
}
}
});
}
修改 contentType的值 添加编码 application/json;charset=utf-8
问题解决了