} catch (Exception e) {
log.error("error while initialising configuration file {}: {}; creating memory-only configuration", configFileName, e.getMessage());
saveConfiguration = new MapConfiguration(new HashMap<String, Object>());
saveMetadata = new MapConfiguration(new HashMap<String, Object>());
}
config = new FallbackConfiguration();
config.addConfiguration(saveConfiguration,true);
// load all default-config.properties
try {
Enumeration<URL> configs = this.getClass().getClassLoader().getResources("config-defaults.properties");
while(configs.hasMoreElements()) {
URL url = configs.nextElement();
config.addConfiguration(new PropertiesConfiguration(url));
}
} catch (IOException e) {
log.error("I/O error while loading default configurations",e);
} catch (ConfigurationException e) {
log.error("configuration error while loading default configurations",e);
}
// legacy support (to be removed)
try {
Enumeration<URL> configs = this.getClass().getClassLoader().getResources("default-config.properties");
while(configs.hasMoreElements()) {
URL url = configs.nextElement();
config.addConfiguration(new PropertiesConfiguration(url));
log.warn("found legacy configuration file {}; should be replaced with per-module configuration!",url);
}
} catch (IOException e) {
log.error("I/O error while loading default configurations",e);
} catch (ConfigurationException e) {
log.error("configuration error while loading default configurations",e);
}
// create the configuration that is responsible for getting metadata about configuration keys in the main
// configuration; since the keys will be different, we store changes also to the main save configuration
configDescriptions = new FallbackConfiguration();
configDescriptions.addConfiguration(saveMetadata,true);
try {
Enumeration<URL> configs = this.getClass().getClassLoader().getResources("config-descriptions.properties");
while(configs.hasMoreElements()) {
URL url = configs.nextElement();