# org.springframework.context.ApplicationContextException: Failed to start bean ‘documentationPluginsBootstrapper’; nested exception is java.lang.NullPointerException
First, The relevant configurations in my pom.xml are as follows
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!--swagger-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
At this point, my spring-boot-starter version may not match the swagger version, and the following error is reported
org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException
Because Springfox uses path matching based on AntPathMatcher, while Spring Boot 2.6.X uses PathPatternMatcher.
Solution:
Configurate in application.properties:
spring.mvc.pathmatch.matching-strategy=ANT_PATH_MATCHER
The problem can be solved.
Read More:
- [Solved] swagger Failed to start bean ‘documentationPluginsBootstrapper‘; nested exception is java.lang.NullP
- [Solved] Failed to start bean ‘documentationPluginsBootstrapper‘; nested exception is java.lang.NullPointerEx
- [Solved] Failed to start bean ‘eurekaAutoServiceRegistration‘; nested exception is java.lang.NullPointerExce
- Request processing failed; nested exception is java.lang.NullPointerException or UnsatisfiedDependencyE
- [Solved] ApplicationContextException: Failed to start bean ‘documentationPluginsBootstrapper‘;
- [Solved] Springboot integrate swagger error: Failed to start bean ‘documentationPluginsBootstrapper‘
- Failed to start bean ‘documentationPluginsBootstrapper‘ [How to Solve]
- Error resolution: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/Datatype
- [Solved] MultipartException: Failed to parse multipart servlet request; nested exception is java.lang.Runtime
- [Solved] Invocation of init method failed; nested exception is java.lang.NoSuchMethodError:
- [Solved] nacos Startup Error: nested exception is java.lang.RuntimeException: java.lang.RuntimeException: [db-load-error
- [Solved] nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter
- Springboot Integrate Swagger2 Error: Failed to start bean ‘documentationPluginsBootstrapper‘;
- nested exception is java.lang.StackOverflowError [How to Solve]
- Java uses class array to report error Exception in thread “main” java.lang.NullPointerException solution
- [Solved] eureka Startup Error: Unable to start web … nested exception is org.springframework.boot.web.server.WebS
- [Solved] eureka Startup Error: Unable to start web … nested exception is org.springframework.boot.web.server.WebS
- [Solved] Springboot integrate swagger error: failed to start bean ‘documentationpluginsbootstrapper‘
- [Solved] org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is
- [Solved] Openfegn Remote Call Error: java.lang.NullPointerException: null