我是靠谱客的博主 缥缈嚓茶,这篇文章主要介绍springboot2.6.x之后版本和swagger冲突问题,现在分享给大家,希望可以做个参考。

错误提示如下:

org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException
	at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:181)
	at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:54)
	at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:356)
	at java.lang.Iterable.forEach(Iterable.java:75)

如果错误和我的差不多,那就没问题了,来解决吧。
解决方法:
springboot2.6.x的版本中springmvc默认路径匹配策略从ANT_PATH_MATCHER改成PATH_PATTERN_PARSER所以就有错误了,解决方法就是在配置文件中改成ANT_PATH_MATCHER模式
我的是yml文件

spring:
  mvc:
    pathmatch:
      matching-strategy: ant_path_matcher

然后就ok了。

最后

以上就是缥缈嚓茶最近收集整理的关于springboot2.6.x之后版本和swagger冲突问题的全部内容,更多相关springboot2内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(127)

评论列表共有 0 条评论

立即
投稿
返回
顶部