com.alibaba.fastjson2.JSONArray cannot be cast to com.alibaba.fastjson2.JSONArray
問(wèn)題
我們使用若依的架子把common抽離出來(lái)一個(gè)jar包,導(dǎo)致從redis中序列化出錯(cuò)
這是由于springboot-devtools 使用restartClassLoader加載了JSONArray
而上層controller中的JSONArray依然是AppClassLoader,兩個(gè)不同的類(lèi)加載器加載的JSONArray沒(méi)法轉(zhuǎn)換。
文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-643616.html
解決辦法
1.去掉spring-boot-devtools依賴
2.修改spring-devtools.properties文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-643616.html
restart.exclude.companycommonlibs=/*.fastjson2.jar
到了這里,關(guān)于關(guān)于fastjson序列化失敗的問(wèn)題的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!