在使用SpringBoot2.7时,由于与Swagger2的版本不兼容引发的ApplicationContextException,解决方法是在application.yml中配置spring.mvc.pathmatch.matching-strategy:ant_path_matcher

org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException

报错原因:springboot 2.7和swagger2版本有冲突
解决方法:在application.yml添加如下配置:

spring: 
     mvc:
        pathmatch:
          matching-strategy: ant_path_matcher
Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐