报错信息:
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 'studentController' method
com.exam.controller.StudentController#queryAll()
to {GET /queryAll}: There is already 'adminController' bean method
com.exam.controller.AdminController#queryAll() mapped.
错误原因:
项目中的Controller(控制层)接口重名了(queryAll),如下图所示: