1)报错信息
java.lang.IllegalStateException: Annotation @EnableCircuitBreaker found, but there are no implementations. Did you forget to include a starter?

2)原因
因为我使用了复合注解@SpringCloudApplication
pom.xml中却没有导入Hystrix的依赖

3)解决办法
加入依赖

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
4)启动成功

本文探讨了一次开发中遇到的Java报错,涉及@EnableCircuitBreaker注解但未实现的问题。原因在于Spring Cloud应用中缺少Hystrix starter的依赖。通过添加相关依赖并启动成功,展示了如何修复这种常见错误。
1743

被折叠的 条评论
为什么被折叠?



