0
点赞
收藏
分享

微信扫一扫

springboot集成swagger2遇到的问题及解决方法

丹柯yx 2022-01-06 阅读 82

1、报错“Failed to start bean ‘documentationPluginsBootstrapper’; nested exception is java.lang.NullPointerException”

Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException

解决方法:
版本问题。springboot高版本(2.6.2)和swagger2的低版本(2.9.2)不兼容,将springboot版本改为2.4.10后问题解决。
2、弹窗报错“Unable to infer base url. This is common when using dynamic servlet registration or when the API is behind an API Gateway.”
在这里插入图片描述
解决方法:
版本问题。springboot高版本(2.6.2)和swagger2的高版本(2.10.5)也是不兼容的,将springboot版本改为2.4.10后问题解决。

举报

相关推荐

0 条评论