net.sf.json.JSONException: 'object' is an array. Use JSONArray instead
list集合轉換JSON出錯誤
意思是:物件”是一個陣列。使用jsonarray代替。
解決方法:
將JSONObject替換為JSONArray
程式碼:
JsonConfig jsonConfig = new JsonConfig();
jsonConfig.setCycleDetectionStrategy(CycleDetectionStrategy.LENIENT);
JSONArray json = JSONArray.fromObject(newList, jsonConfig);
result = json.toString();
相關文章
- Use SQLite Instead of Local Storage In Ionic FrameworkSQLiteFramework
- Use KTPASS instead of adden to configure mssql.keytabSQL
- 【已解決】ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead.ImportError
- JSONObject和JSONArrayJSONObject
- Docker 版本升級後提示 "graph" config file option is deprecated use "data-root" instead 問題Docker
- Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android ToolAndroidUICompile
- JSONObject與JSONArray的使用JSONObject
- JsonArray和JsonObject遍歷方法JSONObject
- 如何區分jsonarray 和 jsonobjectJSONObject
- 【轉載】Kano Model — Ways to use it and NOT use it
- Oracle Instead of Trigger的用法Oracle
- Oracle Instead of 觸發器的使用Oracle觸發器
- JSONObject與JSONArray 解析JSON格式字串JSONObject字串
- the "in" use in mysqlMySql
- nginx useNginx
- oracle hint_use_concat_use_nl_with_indexOracleIndex
- go 處理 jsonArray 無 key 的 JSON 串GoJSON
- js遍歷拼接list集合物件,JSONArray陣列物件JSON陣列
- plsql use skillsSQL
- GPFS use with OracleOracle
- how to use typeset?
- USE EXPLAIN PLANAI
- java實現將excel表格資料解析成JSONArrayJavaExcelJSON
- Uncaught TypeError: Object [object Object] has no method 'xxx'ErrorObject
- hadoop報:could only be replicated to 0 nodes, instead of 1Hadoop
- js獲取返回jsonArray中最後一個物件的idJSON物件
- Use PHP7PHP
- IPFS_basic_use
- how to use coffee script
- Use index_descIndex
- why use dynamic SQL?SQL
- In Oracle,How to use dumpOracle
- WireGuard Use Notes
- [Typescript] Use Bitwise FlagsTypeScript
- Oracle Hint:USE_NL、USE_MERGE、UESE_HASH(原理)Oracle
- ObjectObject
- hadoop報錯:could only be replicated to 0 nodes, instead of 1Hadoop
- antD——Warning: `callback` is deprecated. Please return a promise instead.Promise