updOneStudent to {POST /stu/updOne}: There is already 'studentController'

秒速五厘米 2023-06-22 05:23 74阅读 0赞
  1. Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webMvcRequestHandlerProvider' defined in URL [jar:file:/C:/Users/86152/.m2/repository/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 'studentController' method
  2. public com.baidu.core.core.ServiceResult com.baidu.controller.StudentController.updOneStudent(com.baidu.entity.Student)
  3. to {POST /stu/updOne}: There is already 'studentController' bean method

重点是这句

  1. com.baidu.controller.StudentController.updOneStudent(com.baidu.entity.Student)
  2. to {POST /stu/updOne}: There is already 'studentController' bean method
  3. 翻译为:
  4. com.baidu.controller.StudentController.updOneStudent (com.baidu.entity.Student)
  5. 到{POST /stu/updOne}:已经有'studentController' bean方法

问题根源就是在controller方法里存在重名的方法,或者请求url
到controller里检查一下改个名字就好

发表评论

表情:
评论列表 (有 0 条评论,74人围观)

还没有评论,来说两句吧...

相关阅读