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 中国大陆许可协议进行许可。

posted @   just1t  阅读(2432)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
💬
评论
📌
收藏
💗
关注
👍
推荐
🚀
回顶
收起