详细报错
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
[user-center:192.168.137.1:7000] 2022-05-18 00:44:02.512 ERROR 17560 [-] [main] o.s.b.d.LoggingFailureAnalysisReporter
***************************
APPLICATION FAILED TO START
***************************
Description:
Field queryService in com.bf.ims.user.controller.SysUserController required a bean of type 'com.bf.ims.search.client.feign.SearchService' 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.bf.ims.search.client.feign.SearchService' in your configuration.
百度出来方法
- spring容器找不到那个类 添加注解 @ComponentScan
- @EnableFeignClients与@ComponentScan有冲突 都会搜索注入指定目录中的 bean @EnableFeignClients指定clients
研究了一下代码 发现他是用自定义注解去扫描客户端代理方式 但是自定义注解里没有EnableFeignClients这个注解去扫描 加上这个注解后成功解决
本质上是扫描包问题