controller中路径重复导致启动异常

添加接口后,启动报错

2020-09-04 10:35:35,370] [WARN] [] org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'documentationPluginsBootstrapper' defined in URL [jar:file:/Users/fred-zhang/Documents/project/repo/io/springfox/springfox-spring-web/2.9.2/springfox-spring-web-2.9.2.jar!/springfox/documentation/spring/web/plugins/DocumentationPluginsBootstrapper.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webMvcRequestHandlerProvider' defined in URL [jar:file:/Users/fred/Documents/project/repo/io/springfox/springfox-spring-web/2.9.2/springfox-spring-web-2.9.2.jar!/springfox/documentation/spring/web/plugins/WebMvcRequestHandlerProvider.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'serverInfoController' method 
public ResultInfo<java.util.List<AvailavleBuyIpListResponse>> ServerInfoController.vpcIpList(java.lang.Integer,java.lang.Integer)
to {[/resource/vpc/iplist/{client_id}],methods=[GET],produces=[application/json;charset=UTF-8]}: There is already 'serverInfoController' bean method
publicResultInfo<VpcIpResponse> ServerInfoController.zoneUserLanServerList(java.lang.Integer,java.lang.String,java.lang.Integer) mapped

提示比较明显, 映射出现 不确定性,路径有重复。

原文地址:https://www.cnblogs.com/idea-persistence/p/13613339.html