异常显示(主要信息):
Caused by: java.lang.IllegalStateException: java.lang.RuntimeException: Cannot Create new Replica Node :JerseyReplicationClient: http://127.0.0.1:8200/eureka/apps/:
Caused by: java.lang.RuntimeException: Cannot Create new Replica Node :JerseyReplicationClient: http://127.0.0.1:8200/eureka/apps/:
Caused by: java.lang.NoClassDefFoundError: com/sun/jersey/client/apache4/config/DefaultApacheHttpClient4Config
Caused by: java.lang.ClassNotFoundException: com.sun.jersey.client.apache4.config.DefaultApacheHttpClient4Config
本人工程依赖:
通过不断的查找,终于找到了解决方法(关于依赖的配置):
关于原作者解决方案(有兴趣的同学可以去看看):Error setting up eureka server in spring boot
1.添加依赖:
<dependency>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-apache-client4</artifactId>
<version>1.19.4</version>
</dependency>
2.删除依赖:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
本人采集方法二,最终完成的效果: