当前位置: 首页 > news >正文

报错 There is already ‘contestController‘ bean method

报错类似于

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webMvcRequestHandlerProvider' defined in URL [jar:file:/F:/mavenRepository/io/springfox/springfox-spring-webmvc/2.10.5/springfox-spring-webmvc-2.10.5.jar!/springfox/documentation/spring/web/plugins/WebMvcRequestHandlerProvider.class]: Unsatisfied dependency expressed through constructor parameter 2; 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 'contestController' method 
com.yupi.yoj.controller.ContestController#getEndContest()''Caused by: 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 'contestController' method 
com.yupi.yoj.controller.ContestController#getEndContest()o.s.test.context.TestContextManager      : Caught exception while allowing TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener@43ab4e83] to prepare test instance [com.yupi.yoj.mq.FanoutConfigTest@46ebfc09]
java.lang.IllegalStateException: Failed to load ApplicationContextThere is already 'contestController' bean method

原因:
有两个接口的url相同
解决办法:
修改至每个接口有独立的url


http://www.mrgr.cn/news/43616.html

相关文章:

  • Rocky Linux 9搭建K8s-1.28.0+docker一主多从集群测试环境
  • 如何在Allegro中创建实现可以走线但不能铺铜的区域
  • 【rCore OS 开源操作系统】Rust 异常处理
  • 统一 SASE 架构中的网络和安全融合
  • 【WPF开发】控件介绍-Grid(网格布局)
  • Spring源码-AOP具体源码
  • Electron Vue框架环境搭建 Vue3环境搭建
  • 一款基于.NET开发的简易高效的文件转换器
  • Nexus制品库搭建(maven)
  • Singleton(单例模式)
  • 队列的实现与讲解
  • 量子计算:下一次科技革命的引擎
  • 1分钟搞懂K8S中的NodeSelector
  • 银从法律法规_20
  • HugginngFace的Trainer的常见用法
  • Python使用matplotlib绘制图形大全(曲线图、条形图、饼图等)
  • 二叉搜索树 (BST) 节点插入、查找、删除、获取最大值、最小值和中序遍历排序等功能
  • 每日一题|134. 加油站|循环数组单次遍历
  • PriorityQueue分析
  • 数据结构阶段测试2的一点小补充