完整异常信息:
Cannot invoke “org.springframework.web.servlet.mvc.condition.PatternsRequestCondition.getPatterns()” because “this.condition” is null
异常场景:
springboot2.6.x 搭配 springfox 3.0.0
出现原因:
springfox 3.0.0 错误导致
解决方法:两种情况
- 项目中存在
spring-boot-starter-actuator依赖- 降级到 springboot 2.6.0 以下版本
- 修改 springfox 版本(目前只有 3.0.0 版本,等新版本或用其他技术替换)
- 项目中不存在
spring-boot-starter-actuator依赖- 配置文件中加入
spring.mvc.pathmatch.matching-strategy=ant_path_matcher
本文探讨了在Spring Boot 2.6.x版本与springfox 3.0.0配合时遇到的异常,介绍了项目包含或不包含actuator依赖时的解决方法,包括降级版本和配置路径匹配策略。
1893

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



