Question
What causes the 'Failed to start bean documentationPluginsBootstrapper' error when using Spring Boot 2.6.0 and Springfox 3?
N/A
Answer
The 'Failed to start bean documentationPluginsBootstrapper' error typically occurs due to configuration issues when integrating Springfox with Spring Boot 2.6.0 and Jetty server. This is often a result of classpath conflicts or misconfigurations in the Spring context.
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-jetty'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'io.springfox:springfox-boot-starter:3.0.0'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
Causes
- Incompatible versions of Springfox and Spring Boot.
- Not properly excluding deprecated dependencies from the project.
- Missing or misconfigured Spring MVC components.
Solutions
- Ensure compatibility between Springfox 3 and Spring Boot 2.6.0. Consider using Springfox 3.0.0 or later versions.
- Verify that your dependencies in `build.gradle` do not contain unnecessary exclusions or conflicting libraries.
- Since you are using Jetty instead of Tomcat, ensure that Jetty is properly set up and initialized within your Spring context.
Common Mistakes
Mistake: Not excluding the correct servlet starter for Jetty.
Solution: Ensure to replace `spring-boot-starter-tomcat` with `spring-boot-starter-jetty` in your dependencies.
Mistake: Using conflicting versions of libraries.
Solution: Verify that all dependencies, including Spring Boot and Springfox, are compatible. Use the same version number or higher as specified in the Springfox documentation.
Helpers
- Spring Boot 2.6.0
- Springfox 3
- documentationPluginsBootstrapper error
- Jetty server
- Gradle build errors