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
相关推荐
panxianren4 小时前
Bun 1.4 的 bun test --parallel 将 4 秒的测试套件缩短到约 1 秒
java·javascript
码事漫谈5 小时前
骂AI,会让它做得更好吗?
后端
sunshine22 girl6 小时前
Java学习七 Java 项目实战2-注册业务
java·学习
萧瑟余晖6 小时前
Spring Boot 核心理念与快速上手
spring boot
陈随易6 小时前
bm2,Node.js 与 Bun 项目部署新选择
前端·后端·程序员
省钱兄--zs6 小时前
北京24小时自助健身房系统软件开发实战:从架构设计到部署指南
java·数据仓库·spring boot·小程序·需求分析
youdexiang7 小时前
Android录音软件时间关键词检索功能分析
java·人工智能
架构技术专栏7 小时前
AI Agent 框架怎么选:从一次制度查询拆出技术边界
后端·面试
sunshine22 girl7 小时前
Java学习七 Java 项目实战1-项目创建和主页面搭建
java·开发语言·学习
code2cat7 小时前
Java进阶篇之AtomicStampedReference:引用回到原值,版本戳仍能记住变化
java·cas·并发编程·aba