The problem is that we always have reloading for the configuration in our blueprint xmls and we always generate both cm-properties and property-placeholder, e.g.
<property-placeholder xmlns=" http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.2.0" persistent-id="properties1" update-strategy="reload"/> <cm-properties xmlns=" http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.2.0" id="properties1" persistent-id="properties1" update="true"/> śr., 13 lut 2019 o 14:37 Christian Schneider <ch...@die-schneider.net> napisał(a): > I think generally this can always happen. > > I usually use update-strategy="reload" to make sure the new config is > applied. > > See > > https://github.com/cschneider/Karaf-Tutorial/blob/bf7c69efee2a49422106820a52e9a7ec24131bc3/configadmin/configapp-blueprint/src/main/resources/OSGI-INF/blueprint/context.xml#L9 > > Christian > > Am Mi., 13. Feb. 2019 um 14:11 Uhr schrieb Dominik Przybysz < > alien11...@apache.org>: > > > Hi, > > we have a problem with Blueprint in newest Karaf versions. We try to > > upgrade Karaf from version 4.0.4 to 4.2.2/4.2.3. As we do that, we have > a > > strange situation during application startup. Bundles await for Config > > Admin startup (opinion based on logs), but after that, sometimes our CM > > Properties are injected empty. This is nondeterministic - sometimes > > injection works fine, sometimes not. It looks like some kind of the race > > between threads. On 4.0.4 everything seems to work fine. > > > > Steps to reproduce: > > 1. Build Karaf 4.2.2/4.2.3 distribution using karaf-maven-plugin, > including > > a few apps using CM Properties. > > 2. Start you distribution. > > 3. Log injected properties. > > 4. Observe that the properties are sometimes empty (after the bundle > > restart everything is correct). > > > > Apache Karaf (4.0.4) > > > > karaf@root()> list -t 0 | grep -i blueprint > > 11 | Active | 20 | 1.0.1 | Apache Aries Blueprint API > > 12 | Active | 20 | 1.0.7 | Apache Aries Blueprint CM > > 13 | Active | 20 | 1.5.0 | Apache Aries Blueprint Core, Fragments: > 14 > > 14 | Resolved | 20 | 1.0.0 | Apache Aries Blueprint Core Compatiblity > > Fragment Bundle, Hosts: 13 > > 16 | Active | 30 | 1.1.5 | Apache Aries JMX Blueprint API > > 17 | Active | 30 | 1.1.5 | Apache Aries JMX Blueprint Core > > 23 | Active | 30 | 4.0.4 | Apache Karaf :: Bundle :: > > BlueprintStateService > > 26 | Active | 24 | 4.0.4 | Apache Karaf :: Deployer :: Blueprint > > 33 | Active | 30 | 4.0.4 | Apache Karaf :: JAAS :: Blueprint :: > > Config > > > > > > Apache Karaf (4.2.2) > > > > karaf@root()> list -t 0 | grep -i blueprint > > 76 ? Active ? 20 ? 1.0.1 ? Apache > > Aries Blueprint API > > 77 ? Active ? 20 ? 1.3.1 ? Apache > > Aries Blueprint CM > > 78 ? Active ? 20 ? 1.10.1 ? Apache > > Aries Blueprint Core, Fragments: 79 > > 79 ? Resolved ? 20 ? 1.0.0 ? Apache > > Aries Blueprint Core Compatiblity Fragment Bundle, Hosts: 78 > > 80 ? Active ? 30 ? 1.2.0 ? Apache > > Aries JMX Blueprint API > > 81 ? Active ? 30 ? 1.2.0 ? Apache > > Aries JMX Blueprint Core > > 84 ? Active ? 80 ? 1.0.2 ? Apache > > Aries Transaction Blueprint > > 132 ? Active ? 30 ? 4.2.2 ? Apache > > Karaf :: Bundle :: BlueprintStateService > > 133 ? Active ? 24 ? 4.2.2 ? Apache > > Karaf :: Deployer :: Blueprint > > 137 ? Active ? 30 ? 4.2.2 ? Apache > > Karaf :: JAAS :: Blueprint :: Config > > > > What could be a source of problem? Is there any workaround for that? > > > > > -- > -- > Christian Schneider > http://www.liquid-reality.de > > Computer Scientist > http://www.adobe.com > -- Pozdrawiam / Regards, Dominik Przybysz