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注冊信息混亂。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM