Search code examples
activemq-classicapache-karafosgi-bundle

Kar file removal leaves features in place


I'm packaging an application for deployment into Karaf via .kar files. I've noticed that a number of dependent features (from activemq and camel in my example) remain installed even after I have removed the .kar file from the deploy folder.

Is this expected behaviour? I had anticipated the deployment being entirely reversible.

My feature file looks like this:-

<?xml version="1.0" encoding="UTF-8"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0">
    <repository>mvn:org.apache.camel.karaf/apache-camel/2.10.2/xml/features</repository>
    <repository>mvn:org.apache.activemq/activemq-karaf/5.7.0/xml/features</repository>
    <repository>mvn:io.hawt/hawtio-karaf/1.0/xml/features</repository>

    <feature name="jellyfish-messaging" version="0.0.2-SNAPSHOT">

        <!-- core components -->

        <feature version="2.2.8">war</feature>
        <feature version="2.6.3">cxf</feature>
        <feature version="2.10.2">camel-cxf</feature>
        <feature version="2.10.2">camel-blueprint</feature>
        <feature version="2.10.2">camel-jetty</feature>
        <feature version="2.10.2">camel-twitter</feature>
        <feature version="2.10.2">camel-mail</feature>
        <feature version="5.7.0">activemq-blueprint</feature>
        <feature version="5.7.0">activemq-spring</feature>
        <feature version="5.7.0">activemq-web-console</feature>
        <feature version="5.7.0">activemq-camel</feature>

        <!-- jellyfish messaging-specific -->

        <bundle dependency="true">mvn:org.jellyfish/jellyfish-messaging-broker/0.0.2-SNAPSHOT</bundle>

            ...etc etc etc

After I've removed the .kar file, I'm left with this:-

karaf@root>features:list | grep activemq
[uninstalled] [5.4.2          ] activemq                              cxf-2.6.3                 
[installed  ] [5.7.0          ] activemq                              activemq-5.7.0            
[installed  ] [5.7.0          ] activemq-spring                       activemq-5.7.0            
[installed  ] [5.7.0          ] activemq-blueprint                    activemq-5.7.0            
[uninstalled] [5.7.0          ] activemq-optional                     activemq-5.7.0           
[installed  ] [5.7.0          ] activemq-camel                        activemq-5.7.0            
[installed  ] [5.7.0          ] activemq-web-console                  activemq-5.7.0            
[uninstalled] [5.7.0          ] activemq-extra                        activemq-5.7.0            

Thanks,

J.


Solution

  • yes it's an expected behavior. The kar file deployment is an easy way of providing features and bundles in one artifact, though the feature descriptors stay even after the uninstalled kar bundle. Same thing is for installing features an uninstalling of transitive features isn't really supported right now. Work on this is done in the latest version 3.0.0