use of com.evolveum.midpoint.init.interpol.HostnameLookup in project midpoint by Evolveum.
the class StartupConfiguration method createXmlConfiguration.
private void createXmlConfiguration(String filename) throws ConfigurationException {
Map<String, Lookup> lookups = new HashMap<>(ConfigurationInterpolator.getDefaultPrefixLookups());
lookups.put(RandomLookup.PREFIX, new RandomLookup());
lookups.put(HostnameLookup.PREFIX, new HostnameLookup());
FileBasedConfigurationBuilder<XMLConfiguration> builder = new FileBasedConfigurationBuilder<>(XMLConfiguration.class).configure(new Parameters().xml().setFileName(filename).setPrefixLookups(lookups));
/*
On debug level this shows stacktrace for:
DEBUG org.apache.commons.beanutils.FluentPropertyBeanIntrospector - Exception is:
java.beans.IntrospectionException: bad write method arg count:
public final void org.apache.commons.configuration2.AbstractConfiguration.setProperty
This is reportedly beanutils over-strictness issue but is nowhere close to be fixed.
Jira for commons-configuration can be also found, but they rely on beanutils fix.
*/
config = builder.getConfiguration();
config.addProperty(MIDPOINT_HOME_PROPERTY, midPointHomePath);
applyEnvironmentProperties();
resolveFileReferences();
}
Aggregations