springcloud Feign使用时,某服务A调用服务B的类时,找不到


***************************
APPLICATION FAILED TO START
***************************

Description:

Field productClient in com.imooc.order.service.impl.OrderServiceImpl required a bean of type 'com.imooc.product.client.ProductClient' that could not be found.


Action:

Consider defining a bean of type 'com.imooc.product.client.ProductClient' in your configuration.

 

这是因为没有扫描到这些类,

@EnableFeignClients(basePackages = "com.imooc.product.client")

应该有这功能的,但没起到效果,所以又加上了如下
 

@ComponentScan(basePackages = "com.imooc.product.client")

发布了283 篇原创文章 · 获赞 11 · 访问量 14万+

猜你喜欢

转载自blog.csdn.net/liuming690452074/article/details/104542650
今日推荐