当我包含 actuator
时并启用 debug
记录消息然后有很多 Did not find handler method for
日志消息。
2015-08-14 18:34:25.335 DEBUG 94889 --- [nio-8080-exec-5] o.s.b.a.e.mvc.EndpointHandlerMapping : Looking up handler method for path /index.html
2015-08-14 18:34:25.336 DEBUG 94889 --- [nio-8080-exec-5] o.s.b.a.e.mvc.EndpointHandlerMapping : Did not find handler method for [/index.html]
当我删除
actuator
那么这些日志消息就会消失。我已经尝试过 Spring Boot 1.2.5 和 1.3.0.M3 版本,它的工作原理是一样的。用
spring initializr
生成项目很容易试用使用 web
和 actuator
依赖关系。你知道可能是什么原因吗?
谢谢你。
最佳答案
执行器添加 EndpointHandlerMapping
将请求路由到它提供的各种端点。当收到一个请求时,Spring MVC 依次向每个处理程序映射询问请求的处理程序,一旦提供就停止。日志消息是在请求 /index.html
时产生的。制作。没有端点映射到该路径,所以 EndpointHandlerMapping
返回 null
Spring MVC 继续进行下一个映射。
关于spring-boot - "Did not find handler method for"使用 Spring Boot Actuator 记录消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32018323/