spring cloud eureka 遇到的坑

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注册信息混乱。

 

posted on 2018-11-28 22:21  NullToValue 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/nullAndValue/p/10035416.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值