parseObject 错误 "not close json text, token : error"
1.1.41 , pc版本
JSONObject json = JSONObject.parseObject(source);
source: {"code":0,"data":{"country":"中国","country_id":"CN","area":"华东","area_id":"300000","region":"江苏省","region_id":"320000","city":"南京市","city_id":"320100","county":"","county_id":"-1","isp":"联通","isp_id":"100026","ip":"58.240.65.50"}}
com.alibaba.fastjson.JSONException: not close json text, token : error at com.alibaba.fastjson.parser.DefaultJSONParser.close(DefaultJSONParser.java:1290)
请问是什么原因?
请使用最新版本 1.1.46 或1.2.2
android版本1.1.34遇到这个问题,不知道什么情况,升级能解决吗?
translation:
1.1.41, pc version
JSONObject json = JSONObject.parseObject (source);
source: {"code": 0, "data": {"country": "China", "country_id": "CN", "area": "East China", "area_id": "300000", "region": "Jiangsu Province "," region_id ":" 320000 "," city ":" Nanjing "," city_id ":" 320100 "," county ":" "," county_id ":" - 1 "," isp ":" China Unicom "," isp_id ":" 100026 "," ip ":" 58.240.65.50 "}}
com.alibaba.fastjson.JSONException: not close json text, token: error at com.alibaba.fastjson.parser.DefaultJSONParser.close (DefaultJSONParser.java:1290)
May I ask what is the reason?
answer by yakolee: Please use the latest version 1.1.46 or 1.2.2
answer by wangmingshuo: android version 1.1.34 encounter this problem, do not know what the situation, the upgrade can be resolved?
Current issue:
I get the same error message and can't make any sense of it since there is no pointer to where the error is. I'd love to see that the index in the string and some context is reported.
last version 1.2.8 has not this problem.