XiLai Dai
2012-07-30 06:16:12 UTC
Hi,
In the blueprint xml of the bundle we have <cm:property-placeholder> and <bean> configuration like this:
<cm:property-placeholder persistent-id="x.y.z" update-strategy="reload">
<cm:default-properties>
<cm:property name="myapp.home" value="${karaf.home}/myapp" />
</cm:default-properties>
</cm:property-placeholder>
<bean id="myServer" class="x.y.zImpl">
<property name="myHome" value="${myapp.home}" />
</bean>
And we have a <feature> definition like this:
<feature name='my-feature' version='0.1-SNAPSHOT'>
<configfile finalname="/etc/x.y.z.cfg">mvn:x.y.z/myapp/0.1-SNAPSHOT/cfg/x.y.z</configfile>
<bundle>mvn:x.y.z/myapp/0.1-SNAPSHOT</bundle>
</feature>
When installed this feature into karaf container at first time, ${karaf.home} will not be replaced with the actual path like : /home/karaf2.2.8. Then, after execute refresh <bundle_id> or restart container, ${karaf.home} will be raplaced correctly. Does anyone know possible solution/workaround how to make this happen at the first time of feature installation?
Thanks in advance!
Xilai
In the blueprint xml of the bundle we have <cm:property-placeholder> and <bean> configuration like this:
<cm:property-placeholder persistent-id="x.y.z" update-strategy="reload">
<cm:default-properties>
<cm:property name="myapp.home" value="${karaf.home}/myapp" />
</cm:default-properties>
</cm:property-placeholder>
<bean id="myServer" class="x.y.zImpl">
<property name="myHome" value="${myapp.home}" />
</bean>
And we have a <feature> definition like this:
<feature name='my-feature' version='0.1-SNAPSHOT'>
<configfile finalname="/etc/x.y.z.cfg">mvn:x.y.z/myapp/0.1-SNAPSHOT/cfg/x.y.z</configfile>
<bundle>mvn:x.y.z/myapp/0.1-SNAPSHOT</bundle>
</feature>
When installed this feature into karaf container at first time, ${karaf.home} will not be replaced with the actual path like : /home/karaf2.2.8. Then, after execute refresh <bundle_id> or restart container, ${karaf.home} will be raplaced correctly. Does anyone know possible solution/workaround how to make this happen at the first time of feature installation?
Thanks in advance!
Xilai