【异常】UnsatisfiedDependencyException:Error creating bean with name ‘documentationPluginsBootstrapper‘

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'documentationPluginsBootstrapper' defined in URL [jar:file:/D:/Soft_dev/maven/apache-maven-repository/io/springfox/springfox-spring-web/3.0.0/springfox-spring-web-3.0.0.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:/D:/Soft_dev/maven/apache-maven-repository/io/springfox/springfox-spring-webmvc/3.0.0/springfox-spring-webmvc-3.0.0.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 'databaseController' method 
com.fast.server.controller.DatabaseController#getDatabaseByPage(DatabasePageBody)
to {POST [/database/list]}: There is already 'databaseController' bean method

这个错误似乎是由于在同一个控制器类中有两个相同路径和相同 HTTP 方法的方法。
Spring MVC 在初始化时无法确定要使用哪个方法来处理请求。
要解决这个问题,你可以通过以下几种方式之一:

  1. 修改方法路径或HTTP方法: 确保每个方法的路径或HTTP方法是唯一的,这样就不会出现冲突。例如,将其中一个方法的路径或HTTP方法修改为与另一个方法不同。

  2. 使用不同的控制器类: 将其中一个方法移动到另一个控制器类中,这样就不会有冲突。

  3. 使用@RequestMapping注解进行细粒度控制: 如果你使用的是 @RequestMapping 注解,可以通过使用更具体的路径和条件来进一步细化请求映射,从而避免冲突。

(检查对应的controller中是否出现了相同路径的api)

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小源同学r

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值