Questions tagged [configurationproperties]
89 questions
0
votes
3 answers
Spring boot CORS config with ConfigurationProperties
I have a global CORS configuration which is working well:
@Component
public class CorsConfiguration implements WebMvcConfigurer {
String allowedOrigins = "*";
@Override
public void addCorsMappings(CorsRegistry registry) {
…

ochs.tobi
- 3,214
- 7
- 31
- 52
0
votes
0 answers
External properties @configurationProperties style prefix for proprties with not predefined structure
I have some properties, where some initial part is same and remaining is different for all properties.
can have 1 dot (.) 2,3 or more.
I can't use @ConfigurationProperties to loca these with prefix ="com.some.props" because remaining properties are…

ThrowableException
- 1,168
- 1
- 8
- 29
0
votes
1 answer
Trouble with Spring @ConfiurationProperties extending Mao
I am trying to load come properties from config using the Spring @Configuration & @ConfigurationProperties combination. I have a POJO that extends HashMap and has a single variable inside. (See MyConfigPojo below). From the .yaml…

C Taylor
- 117
- 1
- 9
0
votes
1 answer
@Validated annotation makes field of @ConfigurationProperties class to be null
I have the following two classes and yaml-config:
Class 1:
@ConfigurationProperties
@Validated ֎ 1 ֎
public class SplitterProps {
@Valid
public final ConnectionParams connectionParams;
// @Valid
// @NotNull
public final…

Torino
- 445
- 5
- 12
0
votes
1 answer
Spring does not complain if a property is not set when using ConfigurationProperties
I have a bean that is configured via ConfigurationProperties:
@Component
@ConfigurationProperties(prefix = "mybean")
public class MyBean {
@NotEmpty
private String name;
// Getters, setters, ...
}
I configure the field values via…

fml2
- 190
- 11
0
votes
2 answers
How map properties file using @Configuration properites prefix with dotted properties in Spring?
I have a group of properties as…
user13040636
0
votes
1 answer
In a nested java Spring configuration property class, can a value from the parent be used to init the child?
I have a SpringBoot 2, Kotlin/Java web service that uses @ConfigurationProperties to load up a nested set of classes/properties for its use at runtime. Everything is working properly except for one thing: I cannot figure out how to pass a value…

A Bit of Help
- 1,368
- 19
- 36
0
votes
3 answers
Loading test application.yml properties
I have a test properties file under src/test/resources/application.yml. But I cannot get the values to load in my unit test. I have the following class:
@ConfigurationProperties("snmp")
open class SnmpProperties {
var port: Int = 1611
…

MeanwhileInHell
- 6,780
- 17
- 57
- 106
0
votes
0 answers
Java. Spring. How to register own class-name property
I'm already several days looks for way to define in my properties class (that annotated as @ConfigurationProperties) string property that will be name of class, that implement specified interface. Like an spring.datasource.driver-class-name.
If your…

Иван Белозор
- 1
- 1
0
votes
2 answers
ConfigurationProperties with prefix is not working
I am very new in spring boot and creating my first application. While creating data source I am using @ConfigurationProperties with prefix and properties to be read from application.property.
However, this setup doesn't seems to work for me and my…

Kapil Choubisa
- 5,152
- 9
- 65
- 100
0
votes
2 answers
@ConfigurationProperties reload after programmatically add active profile
I have a class that's annotated with @ConfigurationProperties.
@ConfigurationProperties
@Configuration
@DependsOn("AddDefaultProfile")
public class MyProperties(){
....
}
I have several profiles that's chrome, safari, ie, and en_US, fr_CA etc.
My…

user1491987
- 751
- 1
- 14
- 34
0
votes
1 answer
Spring loads a configuration class with only empty member variables
I have a Spring web application, and I'm trying to load a YAML configuration file into a Java configuration class. However, my configuration class only contains empty member variables after it is instantiated in my JUnit test. I'm new to Spring and…

Magnus
- 589
- 8
- 26
0
votes
1 answer
spring cloud refresh ConfigurationProperties
I want to rebinding ConfigurationProperties data.Read user documentation.
post http://localhost:8080/env,It working .
But post http://localhost:8080/env/reset,Cannot refresh all configurations.
Can only refresh keys that have visited /env.
I want to…

xiao luo
- 777
- 1
- 5
- 6
0
votes
1 answer
Exception in yml binding to nested java object
Facing the below exception when trying to map the yml in the nested java object, is any one also facing the exception, please suggest:
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'alias': Could not bind…

ʞɹᴉʞ ǝʌɐp
- 5,350
- 8
- 39
- 65