Type definition error: [simple type, class net.sf.json.JSONString]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of net.sf.json.JSONString
(no Creators, like default construct, exist): abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information at [Source: (PushbackInputStream); line: 7, column: 21]
翻译为以下:
类型定义错误:【简单类型,class net.sf.json.jsonString】;嵌套异常为com.fasterxml.jackson.databind.exc.invalidDefinitionException:无法构造’net.sf.json.jsonString’的实例(不存在创建者,如默认构造):抽象类型要么需要映射到concrete类型,具有自定义反序列化程序,或在[源:(pushbackinputstream);行:7,列:21]处包含其他类型信息
这是前端传的数据(POSTMAN)测试的:
注意问题在:
detailedList
后台接收用的
private JSONString detailedList;
这里主要是前端传一条数据,数据里包含多条数据
(操作一个表格插入一条数据和另外关联表插入多条数据)
这里的问题主要在于 传入和接收的类型不一致 不能序列化成功
把detailedList 类型直接改成String类型 就可以接收到了,继而用JSONArray转一下,就可以操作数据了