项目启动报错Error creating bean with name 'feignClient' defined in class path resource
时间: 2023-07-21 10:47:35 浏览: 200
Spring_ClassPathResource获得bean对象
[org/springframework/cloud/openfeign/ribbon/HttpClientFeignLoadBalancedConfiguration.class]: Unsatisfied dependency expressed through method 'feignClient' parameter 2; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'httpClient' defined in class path resource [org/springframework/cloud/openfeign/clientconfig/HttpClientFeignConfiguration.class]: Unsatisfied dependency expressed through method 'httpClient' parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connectionManager' defined in class path resource [org/springframework/cloud/openfeign/clientconfig/HttpClientFeignConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.http.conn.HttpClientConnectionManager]: Factory method 'connectionManager' threw exception; 这个错误一般是由于 Ribbon 和 Feign 依赖的 HttpClient 版本不兼容导致的。你可以尝试升级或降级 HttpClient 版本以解决这个问题。同时,也可以检查你的依赖关系是否正确,是否有冲突或缺失的依赖。另外,你可以尝试使用 debug 模式启动项目,查看详细的错误信息以更好地定位问题所在。
阅读全文