Karaf
  1. Karaf
  2. KARAF-1549

Child instance features cfg file looks weird

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.0.0
    • Labels:
      None

      Description

      In a child instance, the etc/org.apache.karaf.features.cfg file looks weird, and completely different from the root instance:

      featuresBoot=config,ssh
      featuresRepositories=mvn\:org.apache.karaf.features/standard/3.0.0-SNAPSHOT/xml/features,mvn\:org.apache.karaf.features/enterprise/3.0.0-SNAPSHOT/xml/features

      More over, the etc/org.apache.karaf.features.obr.cfg and etc/org.apache.karaf.features.repos.cfg files are not present in the child instances, whereas they should be here.

        Activity

        Hide
        Christian Schneider added a comment -

        Can you describe how the files should look like? Can we simply copy the etc/org.apache.karaf.features.obr.cfg and etc/org.apache.karaf.features.repos.cfg from the root ?

        Show
        Christian Schneider added a comment - Can you describe how the files should look like? Can we simply copy the etc/org.apache.karaf.features.obr.cfg and etc/org.apache.karaf.features.repos.cfg from the root ?
        Hide
        Heath Kesler added a comment -

        Hi Jean-Baptiste,

        I looked into this, I assume the 'weird' part is the escaped () : in the mvn or is it just the layout? The escaped character is because the code uses a java.util.properties object to write the feature file on create. Properties.store will escape the : character in the value when writing it. So even tho the property looks right before writing it 'mvn:org.apache......' , the store() will add it to look like 'mvn\:org.apache....'.

        I did update the code to add the repos and the obr configs. But will wait for your feedback on the escaped character (if that is even the weird part) to attach the patch.

        Thanks
        Heath

        Show
        Heath Kesler added a comment - Hi Jean-Baptiste, I looked into this, I assume the 'weird' part is the escaped () : in the mvn or is it just the layout? The escaped character is because the code uses a java.util.properties object to write the feature file on create. Properties.store will escape the : character in the value when writing it. So even tho the property looks right before writing it 'mvn:org.apache......' , the store() will add it to look like 'mvn\:org.apache....'. I did update the code to add the repos and the obr configs. But will wait for your feedback on the escaped character (if that is even the weird part) to attach the patch. Thanks Heath
        Hide
        Heath Kesler added a comment -

        Hi Jean-Baptiste,

        I went ahead and posted the patch for the files to be copied for a child instance. Still not sure about the weird part for the features. I believe you are referring to the escape character but not sure.

        Cheers
        Heath

        Show
        Heath Kesler added a comment - Hi Jean-Baptiste, I went ahead and posted the patch for the files to be copied for a child instance. Still not sure about the weird part for the features. I believe you are referring to the escape character but not sure. Cheers Heath
        Hide
        Jean-Baptiste Onofré added a comment -

        No, it was a biggest issue than that. AFAIR, it was local absolute path in the child instances file instead of relative "generic" path. I gonna check.

        Thanks anyway.

        Show
        Jean-Baptiste Onofré added a comment - No, it was a biggest issue than that. AFAIR, it was local absolute path in the child instances file instead of relative "generic" path. I gonna check. Thanks anyway.
        Hide
        Achim Nierbeck added a comment -

        Ok, the reason for those "strange" looking configuration files is the following.
        The templates used for the creating a new instance is used from the std. karaf templates. Since the usage of the new features plugin those templates only contain the config feature as boot feature everything else is added to the features during assembly time, and only for the full version. The minimal Version of Karaf only contains config and framework.

        So basically this only depends on the "root" instance, if it's a minimal version it should also include the framework as boot feature, if it's a full version it should contain more. The next question is, do we want to create a "clone" of the root instance, I don't think so, so we need to differ somehow between a original minimal and full instance ...

        Show
        Achim Nierbeck added a comment - Ok, the reason for those "strange" looking configuration files is the following. The templates used for the creating a new instance is used from the std. karaf templates. Since the usage of the new features plugin those templates only contain the config feature as boot feature everything else is added to the features during assembly time, and only for the full version. The minimal Version of Karaf only contains config and framework. So basically this only depends on the "root" instance, if it's a minimal version it should also include the framework as boot feature, if it's a full version it should contain more. The next question is, do we want to create a "clone" of the root instance, I don't think so, so we need to differ somehow between a original minimal and full instance ...
        Hide
        Achim Nierbeck added a comment -

        After thinking about this some more and starting a philosophical discussion with myself I came to the conclusion, that the current fix

        Author: anierbeck
        Date: Thu May 23 14:51:04 2013
        New Revision: 1485746

        URL: http://svn.apache.org/r1485746

        should be enough

        If one want's a exact replicate of the root instance one needs to do the clone command. If that isn't the case the person using the create needs to make sure he knows beforehand what kind of boot features are required.

        Usually the clone of the root should be sufficient

        Show
        Achim Nierbeck added a comment - After thinking about this some more and starting a philosophical discussion with myself I came to the conclusion, that the current fix Author: anierbeck Date: Thu May 23 14:51:04 2013 New Revision: 1485746 URL: http://svn.apache.org/r1485746 should be enough If one want's a exact replicate of the root instance one needs to do the clone command. If that isn't the case the person using the create needs to make sure he knows beforehand what kind of boot features are required. Usually the clone of the root should be sufficient
        Hide
        Achim Nierbeck added a comment -

        Oh, reopen this one if you disagree

        Show
        Achim Nierbeck added a comment - Oh, reopen this one if you disagree

          People

          • Assignee:
            Achim Nierbeck
            Reporter:
            Jean-Baptiste Onofré
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development