ConfigurationPropertiesBindException class
The error thrown when configuration values are invalid: a value that cannot be converted, a required value that is missing, or a validation constraint that fails.
It carries every bad property at once, one line each, so the
developer can fix them all in one go. It is thrown while binding a
@ConfigurationProperties bean, by Binder.bind, and by
SpringApplication for invalid logging.level.* and
spring.main.banner-mode values. A failed start turns it into a
Binding to target properties under '...' failed report. Catch it
only in code that binds by hand and can fall back to defaults.
Spring (Java): BindException / BindValidationException, which
Spring Boot reports in the same way at startup.
- Implemented types
Constructors
-
ConfigurationPropertiesBindException(String prefix, String? beanName, List<
String> errors) -
An exception for the properties under
prefix, bound for the beanbeanName(null outside a bean), with one line per problem inerrors.
Properties
- beanName → String?
-
The name of the bean being bound, or
nullwhen no bean was bound (a Binder.bind call, for example).final -
errors
→ List<
String> -
One line per problem, naming the property:
db.max-size: must be at least 1ordb.hosts[0]: failed to convert to int (was "x").final - hashCode → int
-
The hash code for this object.
no setterinherited
- prefix → String
-
The prefix of the properties being bound, such as
db.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited