InvalidConfigDataPropertyException class final
The startup error for a property written in a config file where it is not allowed.
Profile switches decide which files are read, so they may not appear in
files that are only read because of a profile: spring.profiles.active,
spring.profiles.default, spring.profiles.include and
spring.profiles.group.* fail the start inside
application-dev.properties or inside a document guarded by
spring.config.activate.on-profile. The pre-2.4 key spring.profiles
is rejected anywhere: write spring.config.activate.on-profile.
Applications meet it as a failed start and move the property.
try {
ConfigDataEnvironment(environment).processAndApplySync();
} on InvalidConfigDataPropertyException catch (error) {
log.error('${error.property} in ${error.source}: ${error.reason}');
}
Spring (Java):
// Spring Boot throws the same exception from SpringApplication.run:
// "Property 'spring.profiles.active' imported from location
// 'class path resource [application-dev.properties]' is invalid in a
// profile specific resource"
- Implemented types
Constructors
- InvalidConfigDataPropertyException(String property, String source, String reason)
-
Creates the exception for
property, found in the property source calledsource, with thereasonit is not allowed there.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- property → String
-
The key that is not allowed, such as
spring.profiles.active.final - reason → String
-
Why the property is not allowed there, such as
not allowed in a profile-specific document.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- source → String
-
The name of the property source (file or document) that contains
it.
final
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