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

丹柯yx

关注

阅读 82

2022-01-06

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)

0 0 举报