redis存取值問題,存自定義實體對象;
第一次取的時候報錯:com.alibaba.fastjson.JSONException: autoType is not support。
GenericFastJsonRedisSerializer序列化和反序列化redis的value值,需要bean對象含有無參構造方法。
解決:文章來源:http://www.zghlxwxcb.cn/news/detail-664065.html
? ? ? ? 檢查自定義實體對象是否有無參構造方法;添加有參構造后,jvm不會自動生成無參構造。文章來源地址http://www.zghlxwxcb.cn/news/detail-664065.html
到了這里,關于(已解決)redis.get報錯com.alibaba.fastjson.JSONException: autoType is not support的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!