2 Replies Latest reply on Aug 21, 2013 3:47 AM by tellisnz

    Installing bundles with Fab - Unknown protocol: fab

      Hi All,

       

      I'm attempting to use the fuse application bundle tool in my features.xml as described at the bottom of http://fuse.fusesource.org/bundle/faq.html and install the feature at startup, however I believe I'm having a problem with the startup order.

       

      I believe it's the fabric-bundle feature that includes the Fuse Application Bundles bundle which I have in my org.apache.karaf.features.cfg file as:

       

      #
      # Comma separated list of features to install at startup
      #
      featuresBoot=fabric-bundle,(some other features),myfeature
      

       

      My feature is defined similar to the following:

       

      <feature name="myfeature" version="${project.version}">
          <bundle>fab:mvn:com.company/mybundle/${project.version}</bundle>
      </feature>
      

       

      but when starting up I notice this in my logs:

       

      16:31:20,785 | DEBUG | t-60024-thread-1 | FeaturesServiceImpl              | 22 - org.apache.karaf.features.core - 2.3.0.redhat-60024 | Installing feature myfeature 2.0.0-SNAPSHOT
      16:31:20,786 | DEBUG | t-60024-thread-1 | FeaturesServiceImpl              | 22 - org.apache.karaf.features.core - 2.3.0.redhat-60024 | Checking fab:mvn:com.company/mybundle/2.0.0-SNAPSHOT
      16:31:20,789 | WARN  | t-60024-thread-1 | FeaturesServiceImpl              | 22 - org.apache.karaf.features.core - 2.3.0.redhat-60024 | Error when installing feature myfeature: java.net.MalformedURLException: Unknown protocol: fab
      

       

      I noticed that the Fuse Application Bundles bundle (fab-osgi) is actually started 3 seconds later:

       

      16:31:23,436 | DEBUG | lixDispatchQueue | fab-osgi                         | 61 - org.fusesource.fabric.fab.fab-osgi - 7.2.0.redhat-024 | BundleEvent STARTED - org.fusesource.fabric.fab.fab-osgi
      

       

      Therefore now once the server is started in the shell I can run

       

      features:install myfeature
      

       

      and the feature is successfully installed.

       

      So I believe I need to ensure the Fuse Application Bundles bundle is installed and started at startup prior to attempting to install and start my feature. How can I achieve this?

       

      Cheers,

       

      Tom

        • 1. Re: Installing bundles with Fab - Unknown protocol: fab
          ffang

          Hi,

           

          yeah, this is caused by features service is up and so install features but the fab service isn't up yet at this stage.

           

          You can specify a start-level for your "myfeature", something like

           

          <feature name="myfeature" version="${project.version}" start-level='80'>

           

          to see if it helps.

           

          We may need consider to put fabric-bundle related bundles into etc/startup.properties to ensure fab is available at more early stage, like we do for other deployers.

           

          Freeman

          • 2. Re: Installing bundles with Fab - Unknown protocol: fab

            Hi Freeman,

             

            The start-level='80' didn't help, I'm not sure if the karaf version in 60024 is actually using that, just looking at the doc on http://karaf.apache.org/manual/latest-2.3.x/users-guide/provisioning.html (see the red box under bundle start/stop) - or is the feature start level inherently different from the bundle start level?

             

            Anyway, I had attempted putting together the necessary dependencies for fabric-bundle in my startup.properties earlier but gave up and went down the start level path, so your comment refocussed me on it. After a bit of fiddling, adding the following to my startup.properties loads the fabric-bundle early enough:

             

            org/fusesource/fabric/fab/fab-osgi/7.2.0.redhat-024/fab-osgi-7.2.0.redhat-024.jar=10
            org/fusesource/fabric/common-util/7.2.0.redhat-024/common-util-7.2.0.redhat-024.jar=10
            org/ops4j/base/ops4j-base-net/1.2.2/ops4j-base-net-1.2.2.jar=10
            org/ops4j/base/ops4j-base-lang/1.2.2/ops4j-base-lang-1.2.2.jar=10
            org/ops4j/base/ops4j-base-util-property/1.2.2/ops4j-base-util-property-1.2.2.jar=10
            org/ops4j/pax/swissbox/pax-swissbox-optional-jcl/1.3.1/pax-swissbox-optional-jcl-1.3.1.jar=10
            org/ops4j/base/ops4j-base-monitors/1.2.2/ops4j-base-monitors-1.2.2.jar=10
            org/ops4j/pax/swissbox/pax-swissbox-property/1.2.0/pax-swissbox-property-1.2.0.jar=10
            

             

            So thanks for getting me on that path!

             

            Cheers,

             

            Tom