It is illegal to call this method if the current request is not in asynchronous mode (i.e. isAsyncS

場景

提示信息1:
It is illegal to call this method if the current request is not in asynchronous mode (i.e.
isAsyncStarted() returns false)
提示信息2:
Request processing failed; nested exception is com.alibaba.fastjson.JSONException: write javaBean error, fastjson version 1.2.58, class

這個一般出現序列化的時候。例如攔截器,打印request。

logger.info("request:{}",JSON.toJSONString(request));

解決方案

不直接序列化整個request,而是拿出其中需要的字段進行打印即可。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章