springfox swagger (Failed to start bean 'documentationPluginsBootstrapper')



a. 问题描述:Failed to start bean ‘documentationPluginsBootstrapper'

b. 问题原因:
        使用spring-boot-starter-parent:2.6.xspringfox-boot-starter:3.0.0生成接口文档过程,出现容器刷新失败,应用无法启动问题,显示Failed to start bean 'documentationPluginsBootstrapper',报出空指针异常!原因在于,spring boot已经改用PathPatternParser进行路径匹配解析,而springfox-boot-starter依然使用旧的AntPathMatcher,最终导致documentationPluginsBootstrapperbean创建失败。

c. 解决方法:
        在配置application.properties中将路径匹配策略设置修改即可!

注意: 如果你还使用了spring-boot-starter-actuator,以下设置将不能生效,具体不知道什么鬼原因,费了好大劲,依赖一个一个测出来的!


spring.mvc.pathmatch.matching-strategy=ant_path_matcher


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM