Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.12.0
-
None
-
Unknown
Description
When whitespaces or newlines are used in location attribute of propertyPlaceholder (XML):
<propertyPlaceholder id="camelPropertyPlaceholderConfigurer" location="classpath:a/b/c/environments/base.properties, classpath:a/b/c/environments/${env:ENV}/env.properties, classpath:a/b/c/environments/${ENV}/env.properties" ignoreMissingLocation="true"/>
, the properties are loaded only from the first source (base.properties) in this case. The problem may be in org.apache.camel.component.properties.DefaultPropertiesResolver#loadPropertiesFromClasspath:
protected Properties loadPropertiesFromClasspath(CamelContext context, boolean ignoreMissingLocation, String path) throws IOException { Properties answer = new Properties(); if (path.startsWith("classpath:")) { path = ObjectHelper.after(path, "classpath:"); } InputStream is = context.getClassResolver().loadResourceAsStream(path); if (is == null) { ... } else {...} return answer; }
startsWith returns false as the path are splitted around ,. Trimming the path somewhere around those calls may help.