[ 
https://issues.apache.org/jira/browse/FELIX-5038?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gregor Zurowski updated FELIX-5038:
-----------------------------------
    Description: 
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:

{code:title=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> 
[...] 
{code}

The corresponding configuration file in $KARAF_HOME/etc looks as follows:

{code:title=etc/test.config.cfg}
[...] 
test.property.1 = Test Value 1 
[...] 
{code}

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:

{code:title=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" />
[...]
{code}

The only way to fix synchronization is to add the following attribute 
definition to Metatype:

{code:title=metatype/metatype.xml}
[...]
        <AD name="felix.fileinstall.filename" id="felix.fileinstall.filename" 
            required="true" type="String" default="" description="Don't modify 
this property!" />
[...]
{code}

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

  was:
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


> 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:
> {code:title=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> 
> [...] 
> {code}
> The corresponding configuration file in $KARAF_HOME/etc looks as follows:
> {code:title=etc/test.config.cfg}
> [...] 
> test.property.1 = Test Value 1 
> [...] 
> {code}
> 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:
> {code:title=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" />
> [...]
> {code}
> The only way to fix synchronization is to add the following attribute 
> definition to Metatype:
> {code:title=metatype/metatype.xml}
> [...]
>         <AD name="felix.fileinstall.filename" id="felix.fileinstall.filename" 
>             required="true" type="String" default="" description="Don't 
> modify this property!" />
> [...]
> {code}
> 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)

Reply via email to