Karaf
  1. Karaf
  2. KARAF-697

features:list shows the features that failed installation as installed.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0
    • Component/s: karaf-core
    • Labels:
      None
    • Environment:

      Windows

      Description

      This was observed when attempting to install a feature that was intentionally broken. Upon installation of the feature, an unresolved constraint violation was generated, and osgi:list showed that none of the bundles inside of the broken feature had been installed. However, when running a features:list command, the feature was listed as installed.

      1. karaf-697.txt
        1 kB
        Michael Van Geertruy

        Activity

        Hide
        Michael Van Geertruy added a comment -

        This is the contents of the gimped features.xml file:
        <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
        <features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0" name="foo-0.0.1">
        <feature resolver="(obr)" version="0.0.1" name="foo">
        <bundle>mvn:org.springframework/spring-web/3.0.5.RELEASE</bundle>
        <bundle>mvn:org.springframework/spring-webmvc/3.0.5.RELEASE</bundle>
        </feature>
        </features>

        Again, it was intentionally created to test this issue.

        This creates an unresolved constraint violation which results in all of the bundles in this feature being uninstalled.

        The issue is in the finally block of the FeaturesServiceImpl.jar's installFeatures() method. The finally block sets the callListeners(new FeatureEvent(f, FeatureEvent.EventType.FeatureInstalled, false)); This results in the featurews being listed as installed on features:list for all features that are installed regardless of the success of that installation.

        Show
        Michael Van Geertruy added a comment - This is the contents of the gimped features.xml file: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0" name="foo-0.0.1"> <feature resolver="(obr)" version="0.0.1" name="foo"> <bundle>mvn:org.springframework/spring-web/3.0.5.RELEASE</bundle> <bundle>mvn:org.springframework/spring-webmvc/3.0.5.RELEASE</bundle> </feature> </features> Again, it was intentionally created to test this issue. This creates an unresolved constraint violation which results in all of the bundles in this feature being uninstalled. The issue is in the finally block of the FeaturesServiceImpl.jar's installFeatures() method. The finally block sets the callListeners(new FeatureEvent(f, FeatureEvent.EventType.FeatureInstalled, false)); This results in the featurews being listed as installed on features:list for all features that are installed regardless of the success of that installation.
        Hide
        Michael Van Geertruy added a comment -

        This patch includes the changes referenced by the comments.

        Show
        Michael Van Geertruy added a comment - This patch includes the changes referenced by the comments.
        Hide
        Jean-Baptiste Onofré added a comment -

        First, I try to reproduce the issue on both 2.2.x and trunk (I'm surprised that this issue has not been reported before).

        Show
        Jean-Baptiste Onofré added a comment - First, I try to reproduce the issue on both 2.2.x and trunk (I'm surprised that this issue has not been reported before).
        Hide
        Jean-Baptiste Onofré added a comment -

        There is no problem on karaf-2.2.X: the feature is not installed if the installation failed.

        I reproduced the issue on the trunk.

        Show
        Jean-Baptiste Onofré added a comment - There is no problem on karaf-2.2.X: the feature is not installed if the installation failed. I reproduced the issue on the trunk.
        Hide
        Jean-Baptiste Onofré added a comment -

        Fixed on trunk: revision 1142954.

        Show
        Jean-Baptiste Onofré added a comment - Fixed on trunk: revision 1142954.

          People

          • Assignee:
            Jean-Baptiste Onofré
            Reporter:
            Michael Van Geertruy
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development