
原因:1、SpringBoot版本太高导致集成Swagger2报错
2、因为Springfox使用的路径匹配是基于AntPathMatcher的,而Spring Boot 2.6.X使用的是PathPatternMatcher。
解决方案:1、我用的SpringBoot版本是2.6.1的,可以做版本降级处理,改成低版本的
2、在application.properties末尾添加spring.mvc.pathmatch.matching-strategy=ANT_PATH_MATCHER(yaml同理) 
Failed to start bean ‘documentationPluginsBootstrapper‘; nested exception is java.lang.NullPointerEx
最新推荐文章于 2023-11-10 11:26:26 发布
本文介绍了由于SpringBoot版本过高导致集成Swagger2出现错误的原因,主要是Springfox的路径匹配机制与SpringBoot 2.6.1的PathPatternMatcher不兼容。提供了解决方案,包括将SpringBoot版本降级或在配置中指定使用ANT_PATH_MATCHER匹配策略。通过这两种方式,可以成功解决Swagger2的集成问题。
1万+

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



