Details
-
Bug
-
Resolution: Done
-
Major
-
fuse-esb-7.1.0
-
None
-
None
-
%
Description
Suppose we have a feature file like:
<?xml version="1.0" encoding="UTF-8"?> <features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0">\ <feature name="test-config" version="1.0.0" resolver="(obr)"> <configfile finalname="/etc/test_properties.cfg">mvn:test/config-test/1.0.0-SNAPSHOT/cfg</configfile> <bundle>mvn:test/config-test/1.0.0-SNAPSHOT</bundle> </feature> </features>
Where my bundle is a very simple route that picks up a value from the configuration file:
<cm:property-placeholder persistent-id="test_properties" /> <bean id="exception" class="java.lang.Exception"> <argument value="${text}" /> </bean> <camelContext xmlns="http://camel.apache.org/schema/blueprint"> <route> <from uri="timer:blah" /> <throwException ref="exception" /> </route> </camelContext>
When you start this bundle, the file gets created ok, however, the bundle is already started and has not read it:
16:51:18,061 | ERROR | 4 - timer://blah | DefaultErrorHandler | 147 - org.apache.camel.camel-core - 2.10.0.fuse-71-047 | Failed delivery for (MessageId: ID-wildflower-59341-1361567870710-8-167 on ExchangeId: ID-wildflower-59341-1361567870710-8-168). Exhausted after delivery attempt: 1 caught: java.lang.Exception: ${text}
java.lang.Exception: ${text}
Which is not what we wanted.
I think that KARAF-888 may address this.
In the meantime, we can work around it by having the feature file contain two features, one for the config file and the other for feature. We then install them in order:
FuseESB:karaf@root> features:addurl file:/Users/sjavurek/Fuse/Enterprise/7.1/fuse-esb-7.1.0.fuse-047/nfeat.xml
FuseESB:karaf@root> features:install test-config-file
FuseESB:karaf@root> features:install test-config