springboot 集成Swagger2报错 Failed to start bean ‘documentationPluginsBootstrapper’; nested exception is java.lang.NullPointerException
原因:因为Springfox使用的路径匹配是基于AntPathMatcher的,
而Spring Boot 2.6.X使用的是PathPatternMatcher。
方法1:
修改application.yml
spring:
mvc:
pathmatch:
matching-strategy: ANT_PATH_MATCHER
方法2:
swagger2版本为2.9.2,springboot版本为2.6.2时
Springboot版本过高,降为2.5.6
var code = “c4947b71-5776-406a-a960-643c019da1ff”
本文介绍了SpringBoot集成Swagger2时出现的NullPointerException错误及其原因。针对该问题提供了两种解决方案:一是调整SpringBoot配置文件中的路径匹配策略;二是降低Springboot版本。
600

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



