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