springboot项目集成 Swagger时,报错参数:Failed to start bean ‘documentationPluginsBootstrapper‘解决办法
在 springboot 项目中集成 Swagger 时报错,谷歌百度很多文章都没找到解决办法,而且很多文章基本上都是复制粘贴的二传手。于是博主自己研究调试发现了解决办法,最后项目正常启动。报错参数:Failed to start bean ‘documentationPluginsBootstrapper’; nested exception is java.lang.NullPointerEx
·
在 springboot 项目中集成 Swagger 时报错,谷歌百度很多文章都没找到解决办法,而且很多文章基本上都是复制粘贴的二传手。于是博主自己研究调试发现了解决办法,最后项目正常启动。
报错参数:Failed to start bean ‘documentationPluginsBootstrapper’; nested exception is java.lang.NullPointerException
解决办法:
-
首先检查一下 Swagger 中的依赖 guava 版本与 pom.xml中添加的是否一致,本项目用的 Swagger 是2.9.2,对应的 guava 版本是20.0 。
-
如果上述还是无法解决问题,就需要修改 springboot 的版本为2.3.4.RELEASE。本项目是修改了的 springboot 版本才解决的问题。具体代码如下:
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.3.4.RELEASE</version> <relativePath/> </parent>
最后,启动项目,成功运行!
更多推荐
所有评论(0)