Spring-boot 升级到2.6.+以后,集成Swagger 3.0 一直报错:org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException。

解决方法:在配置文件application.yml 添加以下配置:
spring:
mvc:
pathmatch:
matching-strategy: ant_path_matcher

在将Spring-boot更新到2.6.+版本后,集成Swagger3.0时遇到ApplicationContextException错误,原因是匹配策略问题。为解决此问题,只需在application.yml配置文件中添加`spring.mvc.pathmatch.matching-strategy: ant_path_matcher`配置项即可修复NullPointerException。

809

被折叠的 条评论
为什么被折叠?



