org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException
二.解决方案
根据提供的错误信息和搜索结果,这个问题通常与 Spring Boot 和 Springfox(Swagger)的集成有关。错误提示Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException表明在 Spring Boot 应用启动过程中,documentationPluginsBootstrapper这个 bean 无法正常启动,原因是遇到了空指针异常(NullPointerException)。这通常是由于 Spring Boot 和 Springfox 的版本不兼容导致的路径匹配策略冲突。
1.修改 Spring MVC 的路径匹配策略
修改 Spring MVC 的路径匹配策略 :Springfox 假设 Spring MVC 的路径匹配策略是ant-path-matcher,而 Spring Boot 2.6 及以上版本的默认匹配策略是path-pattern-matcher。您可以通过在application.yml或application.properties配置文件中添加以下配置来解决这个问题: