请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

feign客户端无法注入到controller

以下是我的写的feign客户端:

https://img1.sycdn.imooc.com//szimg/5ae977a8000132cb04690151.jpg

以下是我的controller注入,显示没有bean

https://img1.sycdn.imooc.com//szimg/5ae977e000013f1b05520105.jpg


正在回答 回答被采纳积分+3

插入代码

5回答

慕斯2223337 2018-06-20 21:26:51

在feign客户端加注解 @Component

1 回复 有任何疑惑可以回复我~
菜鸟精髓 2018-05-09 10:45:31

大神,怎么解决的,我的也是,我用的<spring-cloud.version>Finchley.RC1</spring-cloud.version>
,最新的,求教

1 回复 有任何疑惑可以回复我~
  • 我的也出现这个问题了,项目都启动不来,报错如下:
    Description:
    Field productClient in com.wei.order.controller.TestController required a bean of type 'com.wei.product.client.ProductClient' that could not be found.
    Action:
    Consider defining a bean of type 'com.wei.product.client.ProductClient' in your configuration.
    请问你的是怎么解决的吗?
    回复 有任何疑惑可以回复我~ 2018-07-20 21:04:17
提问者 慕粉1835557753 2018-05-02 16:42:43

已经解决了,之前出了问题了,把启动程序的@EnableFeignClients删除了。

1 回复 有任何疑惑可以回复我~
  • 删除,还是报错啊
    回复 有任何疑惑可以回复我~ 2018-05-09 10:45:54
  • 删除,编译还是不通过啊
    回复 有任何疑惑可以回复我~ 2018-05-09 10:46:28
慕粉817216 2018-06-07 00:02:12

这个有解决吗。虽然能用,但是这个红色的总是不爽。


0 回复 有任何疑惑可以回复我~
  • ieda的问题,可以修改设置
    回复 有任何疑惑可以回复我~ 2018-06-07 09:13:44
阿靖哦 2018-05-13 03:44:36

我也这个问题,有解决的吗

0 回复 有任何疑惑可以回复我~
  • ieda的问题,可以修改设置
    回复 有任何疑惑可以回复我~ 2018-06-07 09:13:52
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号