記錄錯誤:Type definition error *** Cannot construct instance of `net.sf.json.JSONString`

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轉一下,就可以操作數據了

發佈了13 篇原創文章 · 獲贊 2 · 訪問量 4974
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章