• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

niwenta

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

View Post

swagger 404 以及版本不兼容处理方法

1.遇到的问题

使用springboot 2.7.2 和 swagger springfox2.92 造成的版本兼容问题

问题1.运行程序的时候直接报错,报错内容是
org.springframework.context.ApplicationContextException: Failed to start bean ‘documentationPluginsBootstrapper’; nested exception is java.lang.NullPointerException
问题2.出现下图

解决方法:

直接在配置文件中 加入 spring.mvc.pathmatch.matching-strategy=ant_path_matcher
原因是: Spring MVC 的路径匹配策略是ant-path-matcher
Spring Boot 2.6 及以上版本的默认匹配策略是path-pattern-matcher
这样可以将 Spring MVC 的路径匹配策略更改为ant-path-matcher,以兼容 Springfox 的要求。

posted on 2025-01-07 21:33  你问我幸福与否  阅读(152)  评论(0)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3