Questions tagged [configurationproperty]
19 questions
92
votes
3 answers
.net Custom Configuration How to case insensitive parse an enum ConfigurationProperty
One of the ConfigurationProperty I have in my ConfigurationSection is an ENUM. When .net parses this enum string value from the config file, an exception will be thrown if the case does not match exactly.
Is there away to ignore case when parsing…

Koda
- 1,709
- 3
- 14
- 15
25
votes
2 answers
Spring-boot: set default value to configurable properties
I have a properties class below in my spring-boot project.
@Component
@ConfigurationProperties(prefix = "myprefix")
public class MyProperties {
private String property1;
private String property2;
// getter/setter
}
Now, I want to set…

Ashvin Kanani
- 831
- 2
- 14
- 22
14
votes
4 answers
How to protect @ConfigurationProperties classes from changes?
To use @ConfigurationProperties annotation one must create a class with getters and setters like that:
@ConfigurationProperties(prefix = "some")
public class PropertiesConfig {
private boolean debug;
public boolean isDebug() {
…

Cherry
- 31,309
- 66
- 224
- 364
5
votes
1 answer
Spring boot @ConfigurationProperties not loaded
As the title says, I'm trying to use Typesafe Configuration Properties to load a list of DataSourceConfig objects. I have lombok for setter/getters
The main application class…

Raghu
- 1,140
- 1
- 14
- 22
3
votes
1 answer
Cucumber Spring Test @ConfigurationProperties not injecting properties to fields of object
I develop springboot + cucumber and selenium based test atuomation.
My spring cucumber infrastructure formed from https://github.com/cucumber/cucumber-jvm/tree/master/spring.
@RunWith(Cucumber.class)
@CucumberOptions(
plugin =…

Can Bezmen
- 112
- 6
3
votes
1 answer
Custom configuration properties - Entry has already been added
I'm developing a windows service that reads information from the app.config at start-up which should allow us to change internal thread configuration without redeploying the service.
I created some custom configuration sections and elements as…

that0th3rGuy
- 1,356
- 1
- 15
- 19
3
votes
1 answer
.NET config: Read a value in the specified Type
I have the following node in my web.config
which is read into the following ConfigurationProperty
public class ParameterElement : ConfigurationElement
{
[ConfigurationProperty("type",…

awj
- 7,482
- 10
- 66
- 120
2
votes
1 answer
How to use Spring Java properties default value in XML
I am looking how to use the Java default properties value in XML without specifying in application YML or what ever.
This is my java configuration and default I want to use this URL value until providing it from YML file. …

Mohankumar Rathinam
- 623
- 1
- 11
- 25
2
votes
0 answers
@SpringBootTest is not loading the properties from @ConfigurationProperties
When I run mvn clean install or mvn spring-boot:run, my integration test or application start is not loading properties from the application properties, but when I run the test from intelliJ Idea, or starts the server through intellij, it works…

krmanish007
- 6,749
- 16
- 58
- 100
2
votes
3 answers
Kotlin spring-boot @ConfigurationProperties
I'm trying to create the following bean AmazonDynamoDBAsyncClientProvider. I've application.properties that defines endpoint and tablePrefix which I'm trying to inject using @ConfigurationProperties
Following is the code snippet for the same. When I…

learnedSch0lar
- 21
- 1
- 3
2
votes
1 answer
Spring RoutingDataSource validationQuery is not being injected
I'm using RoutingDataSource to dynamically create datasources for each tenant of our application. After 8 - 12 hours application application losts connection with database and I'm getting jpa transaction exception. I found that the following…

b0ro
- 23
- 1
- 5
1
vote
1 answer
ConfigurationElement—Combination of Attributes?
Say I have defined a custom AdapterElement : ConfigurationElement with properties Type, Name and Version. Since Name and Version uniquelly identifies the Type property, I would like to enforce the configuration file to have one of the following…

DotNetStudent
- 889
- 9
- 24
1
vote
1 answer
How to access the ConfigurationPropertyAttribute generated for a class with attributes ConfigurationProperty
I have an app with a pretty big configuration.
All configuration sections for each parameter are defined with .Net ConfigurationProperty attributes, that all have a DefaultValue property.
As our product becomes heavily customizable between…

Stephane Rolland
- 38,876
- 35
- 121
- 169
1
vote
0 answers
Bean initialization with no-default constructor and final fields in Spring Boot
In ConfigurationProperties class I have a Map like this:
@ConfigurationProperties(prefix = "some")
public class SomeConfigurationProperties {
private Map map = new HashMap<>();
...
}
And I want in mentioned SomeClass all…

milosdju
- 783
- 12
- 27
1
vote
1 answer
Yaml file is not processed correctly with @ConfigurationProperties
I'm using Spring Boot 1.4.2 for my small project. My configuration class is as below
@Component
@PropertySource("classpath:global1.yml")
@ConfigurationProperties
public class GlobalProperties {
private String name;
private List

marcterenzi
- 319
- 1
- 2
- 10