我创建了两个spring-cloud模块,一个是eureka-server,运行良好,另一个是eureka-client,启动时出错。
2018-07-25 18:06:21.717 ERROR 15352 --- [ main] o.s.c.n.e.s.EurekaRegistration : error getting CloudEurekaClient
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'scopedTarget.eurekaClient' defined in class
path resource [ .
org/springframework/cloud/netflix/eureka/EurekaClientAutoConfiguration$Ref . reshableEurekaClientConfiguration.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; nested exception is
java.lang.RuntimeException: Failed to initialize DiscoveryClient!
github链接是:here您能否帮助我查找错误?
3条答案
按热度按时间w6lpcovy1#
在客户端的pom.xml中使用以下依赖项
72qzrwbm2#
在www.example.com文件中添加此行application.properties
Eureka .客户端.已启用=真
然后尝试重新部署相同的设备。
ubbxdtey3#
尝试添加这两个依赖项后运行,希望它能工作。