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
相关推荐
玖石书1 小时前
ASP.NET Core 迁移至 Spring系列:类库框架篇
java·后端·asp.net
PieroPC1 小时前
Windows 驱动备份与恢复工具 CMD bat
后端
Csvn1 小时前
📊 SQL 入门 Day 12: 窗口函数基础
后端·sql
摇滚侠1 小时前
《SpringBoot 3:入门与应用实战》第 15 章 生产级特性 监控指标 Metrics 阅读笔记
java·spring boot·笔记
骇客野人2 小时前
IDEA 安装 Trae(TRAE AI: Coding Assistant)完整步骤
java·ide·intellij-idea
玖石书2 小时前
ASP.NET Core 迁移至 Spring系列:编译生态篇
后端·spring·asp.net
Java技术小馆2 小时前
AI 如何理解对话
后端
小满zs2 小时前
Go语言第五章(数组和切片)
后端·go
弹简特2 小时前
【Java项目-企悦抽】11-用户与认证模块-实现用户登录03(结束登录功能)-完成测试+对接前端+登录拦截器
java·开发语言
大模型丫丫2 小时前
Loop Engineering:从强化学习视角看 Agent 循环的本质
java·人工智能·学习