Tag Archives: Failed to start bean ‘documentationPluginsBootstrapper’

[Solved] Springboot Integrate Swagger2 3.0.0 Error: Failed to start bean ‘documentationPluginsBootstrapper’

Add dependency


Write swagger2 configuration class

@Enablewebmvc annotation can solve

Failed to start bean ‘documentationpluginsbootstrapper’

public class Swagger2Config {


Start the project and enter the web address

Swagger2.2.x. The website of version x is


For versions of swagger2 after 3.0.0, the website is


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

The error is spring boot version 2.6 or above and springfox swagger version 3.0 Compatibility issues with 0


  • Downgrade springboot to 2.5.X and below
  • In the configuration in the spring configuration file: spring.mvc.pathmatch.matching-strategy=ant_path_matcher
  • However, the springfox bug has lasted for a long time and the team has not resolved it. So I suggest you use spring doc as a replacement

[Solved] Springboot integrate swagger Error: Failed to start bean ‘documentationPluginsBootstrapper‘

The compilation error of ‘documentationpluginsbootstrapper’ of failed to start bean appears after springboot integrates swagger:

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

Solution: add a comment in the startup class: @enablewebmvc

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

Error cause: it may be caused by version mismatch. My spring boot is 2.6.0, but the spring cloud version needs to be compared in this way and cannot be degraded, so it is configured in this way

POM dependency

	 <relativePath/> <!-- lookup parent from repository -->

Startup class:

@EnableWebMvc // Comment out
public class UploadServiceApplication {

    public static void main(String[] args) {
        SpringApplication.run(UploadServiceApplication.class, args);


This configuration may cause the UI page of swagger to fail to open, so the following configuration is required:

import org.springframework.context.annotation.Configuration;
import org.springframework.util.ResourceUtils;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

public class WebMvcConfigurer extends WebMvcConfigurerAdapter {

     * Accessing static resources
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
         * SpringBoot autoconfiguration itself does not map the /swagger-ui.html
         * This path is mapped to the corresponding directory META-INF/resources/
         * Use WebMvcConfigurerAdapter to publish the static files of swagger;

        //Map all /static/** accesses to the classpath:/static/ directory
        registry.addResourceHandler("/static/**").addResourceLocations(ResourceUtils.CLASSPATH_URL_PREFIX +"/static/");