由于 Hystrix,Spring Boot 2 无法启动? [英] Spring Boot 2 fails starting due to Hystrix?
问题描述
我开始研究将 Spring Boot 应用程序从 1.5.x 迁移到 2.这个应用程序依赖于 hystrix,它还不兼容 Spring Boot 2.当我的 pom 中有以下内容时:
I started investigating to migrate a Spring Boot application from 1.5.x to 2. This appliication has a dependency to hystrix, which does not be compatible to Spring Boot 2 yet. When I have the following in my pom:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix</artifactId>
<version>1.4.4.RELEASE</version>
</dependency>
启动应用程序时出现以下错误:
I get the following error when starting the application:
java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.<init>([Ljava/lang/Object;)V
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:125)
有人遇到过吗?有解决方案吗?
Anybody has experienced the same? Is there a solution yet?
推荐答案
我在为使用 spring boot 2.0.x 的 spring boot 微服务集成 hystrix 时遇到了类似的问题.而不是
I have faced similar issue while integrating hystrix for my spring boot microservice that uses spring boot 2.0.x. Instead of
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix</artifactId>
<version>${spring-hystrix.version}</version>
</dependency>
我已经搬到了
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
<version>${spring-hystrix.version}</version>
</dependency>
Spring Boot 2.0.x 应用程序在 spring-cloud-starter-netflix-hystrix 依赖项下正常启动,没有这个问题.
Spring boot 2.0.x application starts fine with the spring-cloud-starter-netflix-hystrix dependency without this issue.
这篇关于由于 Hystrix,Spring Boot 2 无法启动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!