码迷,mamicode.com
首页 > 编程语言 > 详细

spring cloud eureka 遇到的坑

时间:2018-11-28 23:40:39      阅读:878      评论:0      收藏:0      [点我收藏+]

标签:spring   star   cep   auto   led   col   acl   start   service   

1.eureka.client.serviceUrl.defaultZone 中defaultZone不等于default-zone

 使用default-zone eureka客户端会识别不了,会向localhost:8761注册,造成服务发现混乱。

2. eureka 客户端 传递依赖(间接依赖) javaee-api-8.0 与  eureka传递依赖jsr311-api-1.1.1.jar 下javax.ws.rs 相关类冲突

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘scopedTarget.eurekaClient‘ defined in class path resource [org/springframework/cloud/netflix/eureka/EurekaClientAutoConfiguration$RefreshableEurekaClientConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.netflix.discovery.EurekaClient]: Factory method ‘eurekaClient‘ threw exception;

Caused by: java.lang.RuntimeException: Failed to initialize DiscoveryClient!

Caused by: java.lang.ExceptionInInitializerError: null

Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: org.glassfish.jersey.internal.RuntimeDelegateImpl

2018-11-28 21:37:36.197 ERROR o.s.boot.SpringApplication - Application run failed
org.springframework.context.ApplicationContextException: Failed to start bean ‘eurekaAutoServiceRegistration‘; nested exception is java.lang.NullPointerException

解决:项目中pom中引入javaee-api “短路优先” 覆盖传递依赖。

3.使用IP进行配置eurake 但是没有eureka.instance.prefer-ip-address=true时,集群erueka注册信息混乱。

 

spring cloud eureka 遇到的坑

标签:spring   star   cep   auto   led   col   acl   start   service   

原文地址:https://www.cnblogs.com/nullAndValue/p/10035416.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!