Questions tagged [apache-commons-config]

The Commons Configuration software library provides a generic configuration interface which enables a Java application to read configuration data from a variety of sources.

The Apache Commons Configuration software library provides a generic configuration interface which enables a Java application to read configuration data from a variety of sources. Commons Configuration provides typed access to single, and multi-valued configuration parameters as demonstrated by the following code:

Double double = config.getDouble("number");
Integer integer = config.getInteger("number");

Configuration parameters may be loaded from the following sources:

  • Properties files
  • XML documents
  • Windows INI files
  • Property list files (plist)
  • JNDI
  • JDBC Datasource
  • System properties
  • Applet parameters
  • Servlet parameters

Different configuration sources can be mixed using a ConfigurationFactory and a CompositeConfiguration. Additional sources of configuration parameters can be created by using custom configuration objects. This customization can be achieved by extending AbstractConfiguration or AbstractFileConfiguration.

Official Website: http://commons.apache.org/configuration/

Useful Links:

146 questions
0
votes
2 answers

How to temporarily fail/disable REST APIs at runtime?

I am working on an REST service which primarily provides 2 APIs: PUT request and GET request. During a disaster recovery, the service will be in a state where it cannot accept new PUT requests, but can still be able to provide response for GET…
0
votes
1 answer

Apache Commons Configuration

I'm trying to read a Configuration file using Apache Commons, modify some properties and then save the config file. This is the code snippet Configurations propConfig= new Configurations(); try { …
Rasheed
  • 1
  • 1
  • 2
0
votes
1 answer

How to query XMLConfiguration by value with XPath in Apache Commons Configuration?

So I have the following XML file. 23/05/20 01:19:30 qwer1 lol1
Tony Stark
  • 2,318
  • 1
  • 22
  • 41
0
votes
1 answer

Apache Commons Configuration File Location Strategies

I'm new to Linux, Java, and Apache Commons Configuration and am having issues locating a properties file between environments. I'm building a Spring API with Maven on Windows and have a .properties file i want to pull settings from. I also am…
Cam Bruce
  • 5,632
  • 19
  • 34
0
votes
1 answer

Wildfly 17: "User-specified log class 'org.apache.commons.logging.impl.Log4JLogger' cannot be found or is not useable." using commons-configuration2

I'm getting a LogConfigurationException when trying to load the configuration of my application. It's an EAR Java application, deployed in a Wildfly 17 application server locally. I'm using commons-configuration, so I've deployed it as a dependency…
Faliorn
  • 1,351
  • 3
  • 12
  • 24
0
votes
1 answer

Apache Commons Configuration set property to environment variable - how?

My SpringBoot project has the dependency org.apache.commons commons-configuration2 2.4 And…
Carmageddon
  • 2,627
  • 4
  • 36
  • 56
0
votes
1 answer

WildFly 14 missing modules : org/apache/commons/configuration

WildFly 14 is missing the org/apache/commons/configuration module in the package , same for wildfly 15. Is this removed from wildfly distributions for some reason?
0
votes
0 answers

Dynamically load from a properties file in java

I have a config.properties files with names like this: names=john,jane Then I have a class that access that file and loads the names. And I have another class that get a name from somewhere and if that name is in the config.properties prints…
0
votes
0 answers

How to use Apache Commons PropertiesConfiguration as MessageSource in Spring?

I currently use ReloadableResourceBundleMessageSource from Spring as MessageSource in order to read internationalization messages. The version of Spring I use is: 4.3.1.RELEASE
0
votes
1 answer

Unable to start Tomcat due to NoClassDefFoundError: org/apache/commons/configuration/ConfigurationFactory

Our app currently runs on Java 8, but we have older versions that are running Java 6. When I checkout one of these older branches, refresh my Maven repository, clean the workspace (Eclipse IDE), etc doing all the things I tend to do to get our app…
mohammedkhan
  • 953
  • 6
  • 14
0
votes
2 answers

How do you use a CombinedConfiguration to override a default configuration?

When adding configurations to a CombinedConfiguration (from Apache Commons Configuration 2), how do you specify that one configuration overrides another? For example, say I have a default configuration and a user configuration. If I want the user to…
Uyghur Lives Matter
  • 18,820
  • 42
  • 108
  • 144
0
votes
1 answer

ArchaiusAutoConfiguration excluded from spring boot but still not disabling default system configuration

Our company has a security policy for tomcat we will have to request if there is any new security policy required. I am using spring-cloud-starter-hystrix-1.4.1.RELEASE which is using archaius-core-0.7.4.jar. Our server administrators definitely not…
0
votes
1 answer

Apache Configuration add object instead of String

I have a problem with apache Configuration. Is it possible to add objects and not the string representation of them? For example, I would like to save the whole 'SiteNode' and not the "toString()" variant: public void persistSiteTree(Context…
0
votes
3 answers

ReloadingCombinedConfigurationBuilder not reloading after 1 reload

I'm working on a Spring App where I need to access all the property files kept inside a folder. I tried the ReloadingCombinedConfigurationBuilder approach but the configuration is updated only once and then further file changes don't appear. Here is…
100rabh
  • 6,156
  • 5
  • 27
  • 41
0
votes
1 answer

Jenkins Gradle test fails on Commons Configuration

I have a project that uses Apache Commons Configuration. The project is built using gradle. I have some unit test cases written on this project and gradle test works fine when run locally. However when the unit tests are run in Jenkins it…
user4729907