控制台报错:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'endpointHandlerMapping' defined in class path resource [org/springframework/boot/actuate/autoconfigure/EndpointWebMvcManagementContextConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping found. Cannot map 'org.springframework.boot.actuate.endpoint.mvc.MetricsMvcEndpoint@73839f22' bean method
public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
to {[/metrics || /metrics.json],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}: There is already 'org.springframework.boot.actuate.endpoint.mvc.MetricsMvcEndpoint@73839f22' bean method
public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.MetricsMvcEndpoint.value(java.lang.String) mapped.
解决办法:
经排查,是由于pom.xml文件中,spring-webmvc版本冲突导致的。
网友评论