About the annotation @EnableCircuitBreaker in spring cloud 2020
异常信息
java.lang.IllegalStateException: Annotation @EnableCircuitBreaker found, but there are no implementations. Did you forget to include a starter?
at org.springframework.cloud.commons.util.SpringFactoryImportSelector.selectImports(SpringFactoryImportSelector.java:77) ~[spring-cloud-commons-3.0.0-M6.jar:3.0.0-M6]
at org.springframework.context.annotation.ConfigurationClassParser$DefaultDeferredImportSelectorGroup.process(ConfigurationClassParser.java:904) ~[spring-context-5.3.1.jar:5.3.1]
在SpringCloud2020的早起版本中,CircuitBreaker的实现都是基于SpringCloud 2.x的,可以理解为暂时还没有CircuitBreaker的实现。
解决办法:暂时不用@EnableCircuitBreaker,注意@SpringCloudApplication由@EnableDiscoveryClient和@EnableCircuitBreaker组成,会隐式开启CircuitBreaker
参考:https://github.com/spring-cloud/spring-cloud-commons/issues/863
NoSuchMethod
异常信息
reactor.netty.http.client.HttpClient.chunkedTransfer(Z)Lreactor/netty/http/client/HttpClient;
思考:方法缺失一般思考版本不对或者版本冲突
注意:SpringCloud和SpringBoot有严格的版本对应关系
| springcloud | springboot |
|---|---|
| 2020.0.x aka Ilford | 2.4.x |
| Hoxton | 2.2.x, 2.3.x (Starting with SR5) |
| Greenwich | 2.1.x |
| Finchley | 2.0.x |
| Edgware | 1.5.x |
| Dalston | 1.5.x |
参考:https://spring.io/projects/spring-cloud
版权声明:本文为weiwoyonzhe原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。