Cannot invoke “org.springframework.web.servlet.mvc.condition.PatternsRequestCondition.getPatterns()“
异常信息:
Cannot invoke “org.springframework.web.servlet.mvc.condition.PatternsRequestCondition.getPatterns()” because “this.condition” is null
出现该异常的环境:
springboot 2.6.8 + springfox 3.0.0
通过在网上翻博客查资料发现出现异常的原因主要在于springfox3.0.0
解决办法:
因为我是在springboot+rabbitmq的时候出现的,所以在maven中添加了
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
所以不能通过解决spring2.6+swagger2那样解决,只需要换一个springboot的版本就好了(版本需要在springboot2.6.x以下)
如果没有引入actuator依赖,就可以向解决spring2.6+swagger2那样在application配置文件中添加以下配置就好了:
spring:
mvc:
pathmatch:
matching-strategy: ant_path_matcher
本文作者:just1t
本文链接:https://www.cnblogs.com/just1t/p/16978943.html
版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步