Failed to start bean ‘documentationPluginsBootstrapper’; nested exception is java.lang.NullPointerEx

Failed to start bean ‘documentationPluginsBootstrapper’; nested exception is java.lang.NullPointerEx,第1张

项目场景:

springboot 集成Swagger2启动报错

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

问题描述
org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException
原因分析:

Springboot2.6以后将SpringMVC 默认路径匹配策略从AntPathMatcher 更改为PathPatternParser,导致出错


解决方案:

在配置文件application.properties中加入以下配置

spring.mvc.pathmatch.matching-strategy=ANT_PATH_MATCHER

如果是application.yml就加入

spring:
  mvc:
    pathmatch:
      matching-strategy: ant_path_matcher

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/874164.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-08
下一篇 2022-05-08

发表评论

登录后才能评论

评论列表(0条)

保存