搭建springcloud时导入spring-cloud-starter-eureka-server依赖后报错,如下:

Error creating bean with name 'formContentFilter' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.web.servlet.filter.OrderedFormContentFilter]: Factory method 'formContentFilter' threw exception; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.fasterxml.jackson.datatype.jsr310.JavaTimeModule]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: com/fasterxml/jackson/datatype/jsr310/ser/ZoneIdSerializer

原因:各springboot环境依赖版本过高导致冲突,原先的依赖版本如下:
在这里插入图片描述
解决办法:降低springboot环境依赖版本为2.1.3后,如下:
在这里插入图片描述
Spring Eureka成功访问,如下:
在这里插入图片描述

Logo

云原生社区为您提供最前沿的新闻资讯和知识内容

更多推荐