java.lang.IllegalStateException: No thread-bound request found, exception in aspect

前端 未结 5 1163
不知归路
不知归路 2021-02-02 08:20

Following is my aspect:

    @Configurable
    @Aspect
    public class TimingAspect {

        @Autowired
        private HttpServletRequest httpServletRequest;
         


        
5条回答
  •  别那么骄傲
    2021-02-02 08:55

    Create bean for RequestContextListener. I got the same error for autowiring HttpServletRequest And the following two lines of code works for me

    @Bean
    public RequestContextListener requestContextListener() {
        return new RequestContextListener();
    }
    

提交回复
热议问题