Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2023-02-14 21:42:10.851 ERROR 7392 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Field goodsFeignService in com.waper.auth.controller.UserController required a bean of type 'com.waper.goodsserviceapi.feign.GoodsFeignService' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type 'com.waper.goodsserviceapi.feign.GoodsFeignService' in your configuration.
网上看到说是:
如果只有一个启动类中存在@EnableFeignClients注解,那么不需要加basepackage也不会报错并启动成功;
但是一旦有了两个或以上的业务模块作为feign客户端,也就是有两个以上的启动类上存在@EnableFeignClients注解,不加basepackage将报如上错误。