Application run failed 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 'toCCustomerController' method
出现此情况的 ,仔细观察当前controller 中的 requestMapping 中 是否存在相同url ,比如说不同方法名的请求路径相同
eg:
@PostMapping("/woxihuandabaitui") public Object A(){ return ""; }
@PostMapping("/woxihuandabaitui")
public Object B(){
return "";
}
woxihuandabaitui 就是原因,Spring不允许映射中存在摸棱两可的requestMapping。改个名就好了,实际中也不可能存在一个类中俩一样的requestMapping,
如果有,那就是你new bee
- IllegalStateException SpringBoot Invocation Ambiguous exceptionillegalstateexception springboot invocation solexception invocation exception driver quot illegalstateexception单词exception invocation ambiguous invocation practices dynamic struts2 ambiguousmatchexception reflection ambiguous 39 builderexception collection ambiguous overloaded ambiguous mathfunc double configdaoimpl constructor ambiguous call