Karaf-4 : ConfigurationAdmin returns Managed Properties as null

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Karaf-4 : ConfigurationAdmin returns Managed Properties as null

sathish_alwar
Hi,

We are using Karaf-4.

Our beans implement ManagedService and we register them using blueprint.xml.
We have placed all our configuration files (pid) under KARAF_HOME/etc and
there are about 80 config files. When we install feature (about 200
bundles), we noticed  "updated(Dictionary properties)" callback method gets
called with null properties sometimes. All bundles in the feature have start
level as 80.

All files under KARAF_HOME/etc are static files and they are not generated
dynamically.

Please let us know why "ConfigurationAdmin" calls updated() with null
properties sometimes and how to resolve this.

Does "ConfigurationAdmin" takes more time to scan files, but updated() gets
called before it reads the file (pid).

Thanks



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
Reply | Threaded
Open this post in threaded view
|

Re: Karaf-4 : ConfigurationAdmin returns Managed Properties as null

jbonofre
Hi,

it's a normal behavior: the managed service first calls an "empty"
configuration and then populate the configuration with the file (coming
from FileInstall).

You have to deal with that like defining default values. You can take a
look how we do in Decanter.

Regards
JB

On 20/06/2018 00:14, sathish_alwar wrote:

> Hi,
>
> We are using Karaf-4.
>
> Our beans implement ManagedService and we register them using blueprint.xml.
> We have placed all our configuration files (pid) under KARAF_HOME/etc and
> there are about 80 config files. When we install feature (about 200
> bundles), we noticed  "updated(Dictionary properties)" callback method gets
> called with null properties sometimes. All bundles in the feature have start
> level as 80.
>
> All files under KARAF_HOME/etc are static files and they are not generated
> dynamically.
>
> Please let us know why "ConfigurationAdmin" calls updated() with null
> properties sometimes and how to resolve this.
>
> Does "ConfigurationAdmin" takes more time to scan files, but updated() gets
> called before it reads the file (pid).
>
> Thanks
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com