You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Gregor Zurowski (JIRA)" <ji...@apache.org> on 2015/09/17 10:33:45 UTC
[jira] [Created] (FELIX-5038) Configuration properties are not
synchronized with config files when adding Metatype information
Gregor Zurowski created FELIX-5038:
--------------------------------------
Summary: Configuration properties are not synchronized with config files when adding Metatype information
Key: FELIX-5038
URL: https://issues.apache.org/jira/browse/FELIX-5038
Project: Felix
Issue Type: Bug
Components: Configuration Admin
Reporter: Gregor Zurowski
Priority: Minor
In a Karaf/Blueprint setup, I noticed an issue related to Config Admin and Felix File Install where configuration properties are not synchronized with the corresponding configuration file once Metatype information is added to the bundle.
In a simple test bundle, the configuration properties are implemented using property placeholders in Blueprint as follows:
blueprint/blueprint.xml
=================
[...]
<cm:property-placeholder id="config-test-blueprint-placeholder"
persistent-id="test.config" update-strategy="reload">
<cm:default-properties>
<cm:property name="test.property.1" value="Test 1" />
</cm:default-properties>
</cm:property-placeholder>
[...]
The corresponding configuration file in $KARAF_HOME/etc looks as follows:
etc/test.config.cfg:
==============
[...]
test.property.1 = Test Value 1
[...]
When adding the following Metatype information, the synchronization mechanism stops working, i.e. changes made in OSGi config admin using webconsole are not written back to the configuration file:
metatype/metatype.xml
==================
[...]
<AD name="Test Property 1" id="test.property.1" required="true"
type="String" default="Default value 1" description="This is test property 1" />
[...]
The only way to fix synchronization is to add the following attribute definition to Metatype:
[...]
<AD name="felix.fileinstall.filename" id="felix.fileinstall.filename"
required="true" type="String" default="" description="Don't modify this property!" />
[...]
This has been also discussed on the Karaf users mailing list, see: http://karaf.922171.n3.nabble.com/Blueprint-Property-Placeholders-with-Metatype-Information-td4042619.html
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)