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
2
votes
2 answers

Not getting whole tag value when include "," in tag value using apache.commons.configuration.tree.ConfigurationNode.getValue()

I am trying to read xml using Apache commons configuration this is my sample xml file Label for iCare OLTP administration. 751
Zcon
  • 153
  • 6
  • 18
2
votes
0 answers

How to use DatabaseConfiguration from apache commons with a properties file configures datasource name

I am moving our config properties from a properties file to a database using apache commons DatabaseConfiguration. Works fine. However, it obviously needs database definition, and I want to load that with a jndi datasource name that is itself a…
Entropy
  • 1,219
  • 6
  • 21
  • 45
2
votes
1 answer

Validate xml against xsd using Apache commos configuration

I am newby of XML. I using Apache Commons XMLConfiguration for my configuration. I need a schema based validation. The xsd is locateded in the resources folder of my java project. The xml and xsd are not located in the same location. Following the…
theShadow89
  • 1,307
  • 20
  • 44
2
votes
1 answer

Apache Commons Configuration: Duplicate entries with enabled auto save

I use a org.apache.commons.configuration.CombinedConfiguration containing two org.apache.commons.configuration.XMLConfiguration instances. One is used as default configuration and is deployed with my JAR the other one is the user configuration that…
user212926
2
votes
1 answer

Simple Apache-commons configuration example throws ConfigurationRuntimeException

I'm trying to test a very simple example given in the Apache-commons configuration library user's guide regarding declaring and creating beans. I copied the code in the example almost word by word, and yet I'm getting a ConfigurationRuntimeException…
Joe
  • 2,994
  • 5
  • 31
  • 34
2
votes
1 answer

Apache Java Configuration API - configuration profiles (inheritance)?

When i was working with Zend Framework, I used to have .ini configuration files, where I could do this: [production] setting1 = abc setting2 = def [development : production] setting1 = ghi And when I turned on the development application profile…
fracz
  • 20,536
  • 18
  • 103
  • 149
2
votes
1 answer

Tracking changes with Apache Commons Configuration

For an upcoming project I am planning to use Apache Commons Configuration. I would like to use the library for reading and writing all configurations of the given application from/to a database. We have the requirement that all configuration changes…
jbandi
  • 17,499
  • 9
  • 69
  • 81
2
votes
3 answers

Problems reading an ini file in Java

I am having trouble using Apache commons configuration to read an ini file. I attached the imports incase I am missing something. Below is an example I found on stackoverflow, and as far as I can find, there are no other examples to look at. The…
user1753429
  • 89
  • 1
  • 7
2
votes
2 answers

What libraries exist for multitenant/conditional configurations for Java?

I'm trying to find a solution for configuring a server-side Java application such that different users of the system interact with the system as if it were configured differently (Multitenancy). For example, when my application services a request…
bacar
  • 9,761
  • 11
  • 55
  • 75
1
vote
2 answers

Java, Apache Commons Configuration XML attributes

I'm reading config from an XML file using Apache's commons.configuration. In one of the sections, I have several lines in the form of: Ideally, I would like to do something like this: List blas =…
salezica
  • 74,081
  • 25
  • 105
  • 166
1
vote
1 answer

How Thread Safe Is Commons-Configuration2 Synchronizer Across Independent Applications

I have a properties configuration file that is accessed by one application and can be modified by another. I need to ensure the reads and writes are synchronized, so that is where I found Apache's Commons-Configuration2 version of…
Chen
  • 103
  • 1
  • 9
1
vote
0 answers

java.lang.NoClassDefFoundError error apache commons configuration

I am trying to create a shared library for Oracle ADF projects. I created a util for reading external file for properties and load into ADF services. So, I created a maven project for this shared project which builds a jar. When adding this library…
1
vote
1 answer

unicode problem with apache common configuration

I am using Apache Commons Configuration for resource bundle generation. As I read from different locale bundle and writing on to target bundle the value is encoding into unicodes values which i don't want. Is there any way to write what ever we get…
Pokuri
  • 3,072
  • 8
  • 31
  • 55
1
vote
1 answer

Passing Variable "aaa.bbb" into a Docker Container Process

Update: the question initially assumed this issue was related to Apache Commons Config behavior. I have updated the question and title to narrow the focus of the question. I am working with the following Apache commons config setup. This setup…
1
vote
1 answer

How to use org.apache.commons.configuration with Coldfusion

I am trying to utilize PropertiesConfiguration to manipulate property files in coldfusion. Using org.apache.commons.configuration version 1.10. propertyFile = "usergui.properties"; config =…
jonesk
  • 103
  • 8