Tag Archives: Swagger reports an error

[Solved] Swagger Startup Error: Failed to start bean ‘documentationPluginsBootstrapper‘

Start swagger in the springboot project. If the following error is reported, two solutions can be adopted:

org.springframework.context.ApplicationContextException: Failed to start bean ‘documentationPluginsBootstrapper’; nested exception is java.lang.NullPointerException

This error is caused by the mismatch between SpringBoot version and Swagger version, the blogger Swagger and Swagger-UI are using Springfox 2.9.2, SpringBoot is automatically provided in Idea when created 2.6.2, Springfox uses path matching based on AntPathMatcher, while Spring Boot 2.6.X uses PathPatternMatcher, the two solutions are as follows:

1. Modify the version of springboot to use the earlier version to solve this problem;

2. Add configuration to YML configuration file: ant_path_matcherspring: mvc: pathmatch: matching-strategy: ant_path_matcher.