fastjson中出现(syntax error, expect {, actual string, pos 0)错误原因分析
前言在使用FastJson时出现报错错误信息如下:syntax error, expect {, actual string, pos 0, fastjson-version 1.2.471代码中我是先把对象进行序列化存入到Redis里面:JSONObject.toJSONString(articleListVO,true);1然后从Redis里面取出:String str = cmRedisTe
前言
在使用FastJson时出现报错
错误信息如下:
syntax error, expect {, actual string, pos 0, fastjson-version 1.2.47
1
代码中我是先把对象进行序列化存入到Redis里面:
JSONObject.toJSONString(articleListVO,true);
1
然后从Redis里面取出:
String str = cmRedisTemplate.getStr(value);
JSONObject.parseObject(str, ArticleListVO.class);
1
2
出现报错,其实我们从Redis里面取出数据进行序列化后,需要添加如下操作:
String str = cmRedisTemplate.getStr(value);
String parse = (String) JSON.parse(str);
ArticleListVO articleListVO = JSONObject.parseObject(parse, ArticleListVO.class);
————————————————
更多推荐



所有评论(0)