2022-07-21 16:50:06.766 [http-nio-10.10.40.172-6030-exec-1] ERROR o.a.c.c.C.[.[localhost].[/].[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.ClassCastException: org.springframework.web.servlet.resource.ResourceHttpRequestHandler cannot be cast to org.springframework.web.method.HandlerMethod] with root cause
java.lang.ClassCastException: org.springframework.web.servlet.resource.ResourceHttpRequestHandler cannot be cast to org.springframework.web.method.HandlerMethod
java.lang.ClassCastException 为类转换异常,是参数属性(类型)在强转无法执行抛出的异常。
在这里是静态资源转换非静态资源失败
如果是接口被识别成静态资源,说明
(1)@Controller、@RequestMapping等bean注解未识别该接口,没有进行注册,导致适配器DispatcherServlet识别成静态资源,分配该静态资源处理器ResourceHttpRequestHandler,故而在转换为HandlerMethod时失败。
(2)在配置静态资源时,将接口配置进



