Caused by: java.lang.IllegalStateException: Ambiguou There is already ‘XXXXXXController‘ bean method

Posted 学习很快乐--数学敏感性思维

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Caused by: java.lang.IllegalStateException: Ambiguou There is already ‘XXXXXXController‘ bean method相关的知识,希望对你有一定的参考价值。

**

报错如下:

**
Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map ‘com.offcn.seckill.feign.SeckillGoodsFeignn’ method
com.offcn.seckill.feign.SeckillGoodsFeignn#findPage(SeckillGoods, int, int)
to {POST /seckillGoods/search/{page}/{size}}: There is already ‘seckillGoodsController’ bean method
原因:有两个及以上的RequestMapping或者GetMapping的名字相同
解决:
1.检查所有其他类里是否有相同的RequestMapping的url一样,若有修改不一样的url即可
2.在使用feign的远程调用的接口里,接口上的RequestMapping和被调用类的RequestMapping的url一样,导致的问题,把接口的RequestMpping的url配置到此接口的方法里即可,去除接口RequestMapping的url配置
如:
换成如下:
若解决了您的问题,请点赞加评论,支持博主的辛苦付出=

以上是关于Caused by: java.lang.IllegalStateException: Ambiguou There is already ‘XXXXXXController‘ bean method的主要内容,如果未能解决你的问题,请参考以下文章

Caused by: org.jboss.netty.channel.ChannelException: Failed to bind to: /0.0.0.0:20880 Caused by: ja

Mathematical Problems Caused by CCD

Caused by SSLError

Caused by: java.lang.NoClassDefFoundError:

caused by a circular import.

异常Caused by: java.lang.ClassNotFoundException: org.springframework.dao.DataIntegrityViolationExcep