It is illegal to call this method if the current request is not in asynchronous mode (i.e. isAsyncStarted() returns false) (如果當前請求未處於異步模式(即isAsyncStarted()返回false),則調用此方法是非法的)


當切面有參數為HttpServletRequest之類的參數時,使用

Object[] args = joinPoint.getArgs();

會占用HttpServletRequest中的上下文,當再次調用 

JSON.toJSONString(args);

為再次嘗試獲取request中的上下文,如果未開啟Servlet異步處理,則會拋出此異常,建議切面獲取參數時過濾掉

List<Object> logArgs = stream.filter(arg -> (!(arg instanceof HttpServletRequest) && !(arg instanceof HttpServletResponse))).collect(Collectors.toList());

 

關於切面代理,多線程,序列化,流處理問題需要更多的深入學習,一起進步。





免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM