Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-5038

Configuration properties are not synchronized with config files when adding Metatype information

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: File Install
    • Labels:
      None

      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:

      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:

      metatype/metatype.xml
      [...]
              <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

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              gzurowski Gregor Zurowski
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: