环境springboot2.7.4,swagger3
springboot2.7.4采用官方默认配置,JDK为17
swagger3依赖
io.springfox
springfox-boot-starter
3.0.0
建立SwaggerConfig(代码略)
直接启动项目报错
org.springframework.context.ApplicationContextException: Failed to start bean ‘documentationPluginsBootstrapper’; nested exception is java.lang.NullPointerException: Cannot invoke “org.springframework.web.servlet.mvc.condition.PatternsRequestCondition.getPatterns()” because “this.condition” is null
解决方案:
application.yml中增加如下配置
spring:
# 2022年10月19日,引用swagger3启动项目报错,引用下面代码后正常启动
spring:
mvc:
pathmatch:
matching-strategy: ant_path_matcher
【无标题】springboot2.7.4引入swagger3启动报错
最新推荐文章于 2024-03-26 21:37:52 发布