0
点赞
收藏
分享

微信扫一扫

配置swagger之后启动报错:Failed to start bean ‘documentationPluginsBootstrapper‘; nested exception is java.la

给项目添加swagger之后,springboot启动报错

Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException

我去百度,很多文章说是springboot版本,和swagger版本的问题。我试过升降版本,都不行。
这是我引的依赖,springboot是2.6.0

        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>2.9.2</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger2 -->
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>2.9.2</version>
        </dependency>

后面找到一个解决办法,在application.properties内配置一个东西

spring.mvc.pathmatch.matching-strategy=ant_path_matcher

然后在启动就ok了,并且可以访问
在这里插入图片描述

举报

相关推荐

0 条评论