springboot启动报错:
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name '*****.CommandPeopleJudgeCommandServiceImpl':
Unsatisfied dependency expressed through field 'fieldInjectHelper'; nested
exception isorg.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name '*****.EntityGenericFieldInjectHelper':
Unsatisfied dependency expressed through field 'siriusClient'; nested exception
isorg.springframework.beans.factory.NoSuchBeanDefinitionException: No
qualifying bean of type '*****.SiriusClient' available: expected at least 1
bean which qualifies as autowirecandidate. Dependency annotations: {
@org.springframework.beans.factory.annotation.Autowired(required=true)}
这个代码是别人写的,看定义SiriusClient也没问题,使用也没问题,就看看扫描是否配置,结果真的是这个问题。
解决:
在使用Feign的时候没有加注解,所以在springboot启动的时候注入找不到Client,无法创建Bean,就启动失败了。
@EnableFeignClients(basePackages = "com.**.infra.external")