org.springframework.beans.factory.UnsatisfiedDependencyException: Error creatie

2,744 阅读1分钟

记录一次错误

spring Boot 项目使用了 FeignClient maven打包启动后报创建 Error creating bean with name 'workFlowFuture': Unsatisfied dependency expressed through field 'workFlowService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.unicom.reservation.rpc.IWorkFlowService': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration$EnableWebMvcConfiguration': Unsatisfied dependency expressed through method 'setConfigurers' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'interceptorConfig': Unsatisfied dependency expressed through field 'tokenInterceptor'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'tokenInterceptor': Unsatisfied dependency expressed through field 'adminFuture'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'adminFuture': Unsatisfied dependency expressed through field 'adminService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.unicom.reservation.rpc.IAdminService': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'mvcResourceUrlProvider': Requested bean is currently in creation: Is there an unresolvable circular reference? 失败 是Feign调用其他服务的 server 创建失败

解决办法

Feign 调用其他服务 要先 把Feign调用的那个服务 install 一下,这样你的maven 仓库就有了你要调用的服务,

如果不是这个问题 那你就要看看 是不是 没有把这个创建失败的类 注入到 spring中使他 成为一个Bean