Uploaded image for project: 'Commons Configuration'
  1. Commons Configuration
  2. CONFIGURATION-468

Defining a XML Properties File in the Configuration Definition File.

    XMLWordPrintableJSON

Details

    Description

      I am using a CombinedConfiguration Object to load a configuration definition file and load all the configuration sources from it.

      I use a config.xml file to load multiple Configuration Sources

      Ex:

       
      <configuration> 
        <header/> 
        <override> 
         <properties fileName="db.properties" autoSave="true" config-name="properties1"/>
      <properties fileName="jms.properties" autoSave="true" config-name="properties2"/>
      <xml fileName="test.xml" autoSave="true" config-name="properties3"/>  </override> 
        <additional/> 
      </configuration> 
      

      My test.xml(XML Properties File) file looks like this

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
      <properties>
        <comment>Description of the property list</comment>
        <entry key="key1">value1</entry>
        <entry key="key2">value2</entry>
        <entry key="key3">value3</entry>
      </properties>
      
      

      What tag should be used in the configuration definition file so that I can Load the XML Properties File from a CombinedConfiguration Object. I tried both <xml/> and <properties/>
      When I do :

      //Intialize the Combined Configuration Object combinedConfig
      combinedConfig.getConfiguration("properties3");
      

      I am getting a XMLConfiguration Object instead of a XMLPropertiesConfiguration Object . Please advice.

      Attachments

        Activity

          People

            Unassigned Unassigned
            raghutpk raghutpk
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1m
                1m
                Remaining:
                Remaining Estimate - 1m
                1m
                Logged:
                Time Spent - Not Specified
                Not Specified