springboot和springcloud整合的时候,版本兼容性问题
楼楼发现今天搭建项目的时候,项目启动突然报这个错
java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.<init>([Ljava/lang/Object;)V
原本项目pom.xml文件是这个
自己在网上搜了下,发现版本不兼容,自己就改成了
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.3.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent>
发现启动的时候,这个时候启动的时候又报了个错!
Parameter 3 of method eurekaRegistration in org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration$RefreshableEurekaClientConfiguration required a bean of type 'com.netflix.appinfo.HealthCheckHandler' that could not be found.
- Bean method 'eurekaHealthCheckHandler' not loaded because @ConditionalOnProperty (eureka.client.healthcheck.enabled) did not find property 'eureka.client.healthcheck.enabled'
自己在配置文件中加了个
eureka.client.healthcheck.enabled=true
加了之后,启动又报错
Bean method 'eurekaHealthCheckHandler' not loaded because @ConditionalOnProp.............
当时找了一大堆资料,不知所以。最后实在没办法,把本地仓库删除(记得删除之前备份),然后重新引入jar包
最后发现,
是这里的问题。望君周知