Exception in thread "Thread-7"
com.alibaba.fastjson.JSONException: not close json text, token : error
at com.alibaba.fastjson.parser.DefaultJSONParser.close(DefaultJSONParser.java:1241)
at com.alibaba.fastjson.JSON.parse(JSON.java:101)
at com.alibaba.fastjson.JSON.parse(JSON.java:88)
at com.alibaba.fastjson.JSON.parseObject(JSON.java:159)
at com.ultrawise.smonitor.dao.impl.SaveContentValueDaoImpl.saveValue(SaveContentValueDaoImpl.java:20)
at com.ultrawise.smonitor.service.impl.SaveContentValueServiceImpl.saveValue(SaveContentValueServiceImpl.java:12)
at com.ultrawise.smonitor.server.ServerSocketListener$ClientHandler.run(ServerSocketListener.java:126)
com.alibaba.fastjson.JSONException: not close json text, token : error
at com.alibaba.fastjson.parser.DefaultJSONParser.close(DefaultJSONParser.java:1241)
at com.alibaba.fastjson.JSON.parse(JSON.java:101)
at com.alibaba.fastjson.JSON.parse(JSON.java:88)
at com.alibaba.fastjson.JSON.parseObject(JSON.java:159)
at com.ultrawise.smonitor.dao.impl.SaveContentValueDaoImpl.saveValue(SaveContentValueDaoImpl.java:20)
at com.ultrawise.smonitor.service.impl.SaveContentValueServiceImpl.saveValue(SaveContentValueServiceImpl.java:12)
at com.ultrawise.smonitor.server.ServerSocketListener$ClientHandler.run(ServerSocketListener.java:126)
at java.lang.Thread.run(Thread.java:745)
问题描述:
web项目开启一个socketserver,通过socket传递的json数据,出现上面的问题
解决办法:后台获得字符串,trim一下,问题解决