org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'routerFunctionMapping' defined in class path resource [com/itheima/reggie/config/WebMvcConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.function.support. RouterFunctionMapping]: Factory method 'routerFunctionMapping' threw exception; nested exception is java.lang.NoClassDefFoundError: com/fasterxml/jackson/dataformat/cbor/CBORFactory
使用mvc消息转换器时报错,注释掉消息转换器代码项目就不报错
pom.xml中添加依赖
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-cbor</artifactId>
<version>2.8.11</version>
</dependency>
可能是jackson版本的问题,换个版本试试
依赖的版本有问题,发生冲突,换换版本试试