nested exception is net.sf.json.JSONException: 'object' is an array. Use JSONArray instead
//最开始代码
JSONObject jsonObject = JSONObject.fromObject(list);
result jsonObject;
//将Object换成Array还是不行
JSONArray jsonArray1 = JSONArray.fromObject(list)
result jsonArray1;
//正确应该是
JsonConfig jsonConfig = new JsonConfig();
jsonConfig.setCycleDetectionStrategy(CycleDetectionStrategy.LENIENT);
JSONArray jsonArray = JSONArray.fromObject(list,jsonConfig);
String result = jsonArray.toString();
return result;