Description
When using properties files in ./etc folder of SMX to configure the bundle, the properties are not picked up when SMX is restarted. The problem is only reproduced for Simple language expressions like ${properties:<key>}. The problem is only present when starting SMX and the bundle is already there, it doesn't occur after deploying the configured bundle into SMX.
The exception says:
java.lang.IllegalArgumentException: Property with key [xslt.dir] not found in properties from text: {{xslt.dir}}, StackTrace: org.apache.camel.RuntimeCamelException: java.lang.IllegalArgumentException: Property with key [xslt.dir] not found in properties from text: {{xslt.dir}} at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1363) at org.apache.camel.builder.ExpressionBuilder$78.evaluate(ExpressionBuilder.java:1784) at org.apache.camel.support.ExpressionAdapter.evaluate(ExpressionAdapter.java:36) at org.apache.camel.builder.ExpressionBuilder$59.evaluate(ExpressionBuilder.java:1397) at org.apache.camel.support.ExpressionAdapter.evaluate(ExpressionAdapter.java:36) at org.apache.camel.scala.dsl.languages.LanguageFunction.evaluate(LanguageFunction.scala:33) at org.apache.camel.scala.ScalaExpression.evaluate(ScalaExpression.scala:30) at org.apache.camel.scala.ScalaExpression.evaluate(ScalaExpression.scala:36) at org.apache.camel.builder.ProcessorBuilder$4.process(ProcessorBuilder.java:103) at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72) at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398) at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191) at org.apache.camel.processor.ChoiceProcessor.process(ChoiceProcessor.java:111) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72) at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398) at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191) at org.apache.camel.processor.Pipeline.process(Pipeline.java:118) at org.apache.camel.processor.Pipeline.process(Pipeline.java:80) at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191) at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:51) at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:110) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72) at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398) at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191) at org.apache.camel.processor.Pipeline.process(Pipeline.java:118) at org.apache.camel.processor.Pipeline.process(Pipeline.java:80) at org.apache.camel.processor.ChoiceProcessor.process(ChoiceProcessor.java:111) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72) at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398) at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191) at org.apache.camel.processor.Pipeline.process(Pipeline.java:118) at org.apache.camel.processor.Pipeline.process(Pipeline.java:80) at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191) at org.apache.camel.component.seda.SedaConsumer.sendToConsumers(SedaConsumer.java:291) at org.apache.camel.component.seda.SedaConsumer.doRun(SedaConsumer.java:200) at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:147) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) Caused by: java.lang.IllegalArgumentException: Property with key [xslt.dir] not found in properties from text: {{xslt.dir}} at org.apache.camel.component.properties.DefaultPropertiesParser.doParseUri(DefaultPropertiesParser.java:120) at org.apache.camel.component.properties.DefaultPropertiesParser.parseUri(DefaultPropertiesParser.java:51) at org.apache.camel.component.properties.PropertiesComponent.parseUri(PropertiesComponent.java:160) at org.apache.camel.component.properties.PropertiesComponent.parseUri(PropertiesComponent.java:119) at org.apache.camel.builder.ExpressionBuilder$78.evaluate(ExpressionBuilder.java:1781) ... 38 more
We also use properties in uris using the following format { {<key>} }. When addressing properties in this way the problem doesn't occur.
In our case when starting SMX two Camel PropertyComponent instances are created: one of them has its locations field uninitialized, the other is created later and it has locations field initialized with something like "blueprint:.cm8". The first component is used by Simple language and fails to find property value, the second is applied from uris and gets the right value of properties. When redeploying the bundle another PropertyComponent is created with locations set and Simple language expressions start using it.
The problem appeared after migrating to SMX5.0.0