Spring Boot 2.6.0 / Spring fox 3 - Failed to start bean 'documentationPluginsBootstrapper'
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.
Spring Boot 2.6.0 introduced various updates and improvements, but it also led to some compatibility issues with certain libraries. One of the common issues developers encounter is the failure to start the bean documentationPluginsBootstrapper when using Springfox 3 with Spring Boot 2.6. In this article, we will explore the problem in detail and provide possible solutions and workarounds.
Understanding the Problem
Springfox is a popular library for generating API documentation in Spring-based applications. The documentationPluginsBootstrapper is a Springfox bean responsible for bootstrapping documentation plugins. When the application starts, Spring initializes this bean to generate API documentation.
Key Error Message
Developers facing this issue usually see an error message resembling the following:
Root Cause Analysis
The primary cause of this issue is the changes in Spring Boot 2.6.0's internal handling of application contexts and bean registration. These changes disrupt the expected initialization flow of Springfox, leading to bean conflicts.
Important Changes in Spring Boot 2.6.0
- Path Matching Strategy: Spring Boot 2.6 introduced changes in the default path matching strategy. Instead of using
PathPatternParser, it now defaults toAntPathMatcher, which is incompatible with Springfox out of the box. - Spring Boot Properties Binding: The change affects Springfox’s initialization, leading to circular dependencies or initialization errors.
Bean Incompatibility
Spring's dependency and bean registration policies became stricter in 2.6.0, able to detect multiple beans matching certain type signatures, which results in conflicts for some pre-existing libraries like Springfox.
Workarounds and Solutions
While a permanent fix may require updates to Springfox, you can apply several workarounds to resolve the conflict:
1. Configure Path Matching Compatibility
Modify your application.properties or application.yml to maintain compatibility with Springfox by using the legacy path matcher:
2. Exclude Certain Auto Configurations
Explicitly exclude problematic auto-configurations from Spring Boot that conflict with Springfox:
3. Use Springfox via Spring Boot Starter
Switching to springdoc-openapi, a similar library fully compatible with Spring Boot 2.6, can be a more permanent solution.
4. Custom Bean Definitions
Manually define any conflicting beans in your application context to avoid automatic bean registration issues:
Summary Table
| Issue | Description | Workaround |
| Bean Conflict | documentationPluginsBootstrapper conflicts with existing beans | Define custom bean or remove existing bean registrations |
| Path Matching Strategy Incompatibility | Spring Boot 2.6 changes to path matching | Use legacy ant-path-matcher in configuration |
| Incompatible Auto Configuration | Spring Boot's auto configurations clash with Springfox | Exclude certain auto-configurations or use alternative documentation libraries |
Additional Resources
- Official Guides: Read the Spring Fox Documentation for more details.
- Spring Boot Upgrade Notes: Acquaint yourself with Spring Boot 2.6.0 Release Notes for an overview of compatibility changes.
These insights and workarounds should help you circumvent the initialization issue with Springfox and Spring Boot 2.6.0, ensuring your application documentation is generated correctly without delays or downtime.
Related reading
- Spring Boot 2.6 regression How can I fix Keycloak circular dependency in adapter?
- Spring Boot 2 - Actuator Metrics Endpoint not working
- Spring Boot 2 - Change Jar Name
- Spring Boot 2 - Unsatisfied dependency on Feign client when autowired for service
- Spring Boot 3 springdoc-openapi-ui doesn't work
- Spring boot 404 error custom error response ReST
- Spring boot 2 Converting Duration java 8 application.properties
- Spring Boot 2 health actuator default mapping

OOD Fundamentals
Master object-oriented design from first principles, SOLID, design patterns, and classic interview problems with hands-on coding.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.