The bean 'eurekaRegistration', defined in class path resource [org/springframework/cloud/netflix/

问题

搭建单机版Eureka环境,启动后报错Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
错误信息:The bean ‘eurekaRegistration’, defined in class path resource [org/springframework/cloud/netflix/eureka/EurekaClientAutoConfiguration E u r e k a C l i e n t C o n f i g u r a t i o n . c l a s s ] , c o u l d n o t b e r e g i s t e r e d . A b e a n w i t h t h a t n a m e h a s a l r e a d y b e e n d e f i n e d i n c l a s s p a t h r e s o u r c e [ o r g / s p r i n g f r a m e w o r k / c l o u d / n e t f l i x / e u r e k a / E u r e k a C l i e n t A u t o C o n f i g u r a t i o n EurekaClientConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/cloud/netflix/eureka/EurekaClientAutoConfiguration EurekaClientConfiguration.class],couldnotberegistered.Abeanwiththatnamehasalreadybeendefinedinclasspathresource[org/springframework/cloud/netflix/eureka/EurekaClientAutoConfigurationRefreshableEurekaClientConfiguration.class] and overriding is disabled.
The bean 'eurekaRegistration', defined in class path resource [org/springframework/cloud/netflix/_第1张图片

解决

修改eureka的artifactId

 
<dependency>
	<groupId>org.springframework.cloudgroupId>
    
    <artifactId>spring-cloud-starter-netflix-eureka-serverartifactId>
dependency>

思路

咱也不知道啥原理,只是查看依赖关系发现spring-cloud-starter-netflix-eureka-server依赖了spring-cloud-netflix-eureka-server,怎么解决的不清楚啊

参考:
1.解决springcloud启动报错The bean ‘eurekaRegistration’, defined in class path resource 【org/springframework/

你可能感兴趣的:(The bean 'eurekaRegistration', defined in class path resource [org/springframework/cloud/netflix/)