前提:在feign调用时统一处理token,加入header中,报错
问题:定时任务需要去远程调用内部的feign服务,报错
org.springframework.scheduling.support.TaskUtils$LoggingErrorHandler[0;39m - Unexpected error occurred in scheduled task
No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.
处理方式:
1:
2:
3:定时任务中