添加负载均衡Ribbon后,启动springboot时 [org/springframework/boot/autoconfigure/web/ServerPropertiesAutoConfiguration.class] cannot be opened because it does not exist报错
jar版本问题,ServerPropertiesAutoConfiguration,在springboot 2.x.x 以后移除了,当springboot>=2.x.x ,其他jar包加载 涉及到ServerPropertiesAutoConfiguration 就会报错了+
我引用的是
<dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-zuul</artifactId><version>1.4.7.RELEASE</version></dependency>
查看Maven官网,修改引用为
<dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-netflix-ribbon</artifactId><version>2.2.9.RELEASE</version></dependency>
版本要对应,否则就会出现各种报错