You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by sathish_alwar <sa...@gmail.com> on 2018/06/19 22:14:04 UTC

Karaf-4 : ConfigurationAdmin returns Managed Properties as null

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

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

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
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é
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com