๐ด The Error You're Seeing
Confirm this matches your console output. If it does, you're in the right place.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'configurationPropertiesBeans' defined in class path resource [org/springframework/boot/autoconfigure/context/ConfigurationPropertiesAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.context.properties.ConfigurationPropertiesBeans]: Factory method 'configurationPropertiesBeans' threw exception; nested exception is java.lang.IllegalStateExceptionโก Quick Fix Works 80% of the time
Check for missing or malformed @ConfigurationProperties classes in your project.
@ConfigurationProperties(prefix = "app")
public class AppProperties { ... }๐ง Why this Happens
Tap to expand the deep technical explanation
Spring Boot's auto-configuration failed while trying to wire up beans annotated with `@ConfigurationProperties`. This is usually because a property is missing, a constructor is invalid, or a third-party library has a conflicting bean definition.
The HITEC City Parking Spot Analogy:
The factory manager is trying to set up a new machine (ConfigurationPropertiesBeans), but the machine's power cord (a specific property or constructor) is faulty. The manager refuses to open the factory until the machine is fixed.
๐ How to Reproduce Confirm this is your error
Create a class with `@ConfigurationProperties(prefix = "app")`. Give it a constructor that requires a parameter that Spring cannot resolve from the properties file. Run the app.
๐ ๏ธ Solutions (5 Ways to Fix)
Add missing properties to application.properties
๐ Use this if your @ConfigurationProperties class expects properties that aren't defined.
If a field in your properties class isn't optional, Spring will fail to bind it if the property is missing.
# application.properties
app.name=MyApp
app.timeout=5000Ensure @ConfigurationProperties class has a no-arg constructor
๐ Use this if you added a custom constructor and broke Spring's binding.
Spring uses setter binding by default, which requires a no-arg constructor. If you add a parameterized constructor, you must use @ConstructorBinding.
@ConfigurationProperties(prefix = "app")
public class AppProperties {
private String name;
public AppProperties() {} // Required for setter binding
}Add @EnableConfigurationProperties annotation
๐ Use this if your properties class is in a different module or not component-scanned.
Explicitly tell Spring to register this properties class as a bean.
@SpringBootApplication
@EnableConfigurationProperties(AppProperties.class)
public class Application { ... }Fix Spring Boot version mismatches
๐ Use this if you recently upgraded Spring Boot but have old third-party dependencies.
Libraries built for Spring Boot 1.x or 2.x might register ConfigurationPropertiesBeans in a way that conflicts with Spring Boot 3.
<!-- Upgrade old dependencies -->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.1.0</version>
</dependency>Exclude problematic auto-configuration
๐ Use this if a specific library's auto-configuration is breaking your context.
If you don't strictly need the library's auto-config, exclude it to bypass the bean creation failure.
@SpringBootApplication(exclude = { ProblematicAutoConfig.class })
public class Application { ... }๐ Version Notes
Standard ConfigurationProperties binding.
Stricter binding, fails fast on invalid constructor signatures.
๐ก๏ธ How to Prevent This Next Time
Always use `@EnableConfigurationProperties` instead of `@Component` on `@ConfigurationProperties` classes.