Scheduled 是异步起线程来处理你的逻辑的
但你配置了 LogIntercept 这个拦截器, 里面的54行中, 会去调用RequestContextHolder.currentRequestAttributes, 但这个方法是需要有 http request 和 response 绑定到当前的线程中的.
由于你是使用的异步线程, 当然没有这个绑定了.
所以这个设计是有问题的. 不要在定时任务中使用 http request 和 response.

相关文章:

  • 2021-06-06
  • 2021-06-17
  • 2022-12-23
  • 2021-12-07
  • 2022-03-09
  • 2022-12-23
猜你喜欢
  • 2022-01-19
  • 2022-12-23
  • 2021-07-09
  • 2021-11-29
  • 2021-11-19
相关资源
相似解决方案