Failed to start bean ‘documentationPluginsBootstrapper‘; nested exception is java.lang.NullPointerE
springboot中集成swagger报错: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException
·
报错
Swagger中报错:
org.springframework.context.ApplicationContextException: Failed to start bean ‘documentationPluginsBootstrapper’; nested exception is java.lang.NullPointerException
截图
原因
因为Springfox使用的路径匹配是基于AntPathMatcher的,而Spring Boot 2.6.X使用的是PathPatternMatcher
解决
需要在application.properties中配置:spring.mvc.pathmatch.matching-strategy=ant_path_matcher
更多推荐
已为社区贡献6条内容
所有评论(0)