Springboot启动报错:Failed to start bean ‘documentationPluginsBootstrapper‘

在使用SpringBoot2.7时,由于与Swagger2的版本不兼容引发的ApplicationContextException,解决方法是在application.yml中配置spring.mvc.pathmatch.matching-strategy:ant_path_matcher

javascript 复制代码
org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException

报错原因:springboot 2.7和swagger2版本有冲突

解决方法:在application.yml添加如下配置:

yaml 复制代码
spring: 
     mvc:
        pathmatch:
          matching-strategy: ant_path_matcher
相关推荐
Leo July4 小时前
【Java】Spring Security 6.x 全解析:从基础认证到企业级权限架构
java·spring·架构
星火开发设计4 小时前
C++ 数组:一维数组的定义、遍历与常见操作
java·开发语言·数据结构·c++·学习·数组·知识
码道功成4 小时前
Pycham及IntelliJ Idea常用插件
java·ide·intellij-idea
消失的旧时光-19435 小时前
第四篇(实战): 订单表索引设计实战:从慢 SQL 到毫秒级
java·数据库·sql
それども5 小时前
@ModelAttribute vs @RequestBody
java
雨中飘荡的记忆6 小时前
深度详解Spring Context
java·spring
Tao____6 小时前
JAVA开源物联网平台
java·物联网·mqtt·开源·ruoyi
yqd6666 小时前
SpringSecurity的使用
java·spring
仙俊红6 小时前
Java Map 家族核心解析
java·开发语言
一嘴一个橘子7 小时前
springMvc 接收参数、cookie、header
java