spring boot +spring cloud 启动报错问题

这个启动异常围绕了我一下午,上网也搜了许多资料,自己做下整合分析,判断觉得可能是spring boot  +spring cloud 的版本冲突问题,于是乎就上网搜了下版本方面的兼容问题,问题最终得以解决。

java.io.FileNotFoundException: class path resource [org/springframework/web/context/ServletContextAware.class] cannot be opened because it does not exist

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [org.springframework.cloud.netflix.eureka.server.EurekaServerAutoConfiguration]

STS(spring tool suite)中创建spring boot 项目,引入spring cloud 的 eureka server 服务,在入口类添加启动eureka服务注册中心注解,配置也一切OK,启动时报如下图错误:

spring boot +spring cloud 启动报错问题

POM文件主要配置文件如下:

spring boot +spring cloud 启动报错问题

上图是结合spring cloud 创建项目最初的POM文件,spring boot 和 spring cloud  都是最新版本,在兼容上可能有些问题,在网上找了些老些稳定的版本两者可以兼容的替换上去,查阅了大量的资料,确定了下面的POM文件的spring boot 和 spring cloud 版本可以正常跑起来

spring boot +spring cloud 启动报错问题