Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-4400

Karaf wrap: protocol with BND properties does not work in a Fabric8 profile

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • jboss-fuse-6.2
    • Karaf
    • None
    • % %
    • Hide

      Reproducing the profile has three parts:

      A. Show that wrap: with BND credentials does work outside Fabric8
      B. Show that the feature we are adding does work in a Fabric8 set-up, without the use of wrap:
      C. Show that the feature fails in a fabric with wrap: and BND properties

      A. Verify that the feature with the wrapped bundle works in non-fabric mode

      A1. Unpack, build, and deploy featurebnd-feature.zip (mvn install)
      A2. Unpack, build, and deploy camelosgimvntest.zip (mvn install)
      A3. You may need to edit the feature XML file in the local Maven repo ($HOME/.m2/repository/net/kevinboone/apacheintegration/bndfeature/1.0.0-SNAPSHOT/bndfeature-1.0.0-SNAPSHOT-features.xml) so that the xmlns attribute refers to features/v1.0.0 (I seem to get v1.3.0, which does not work at all)
      A4. Install and start Fuse 6.2.0
      A5. Create the file /tmp/bnd.properties (can be empty)
      A6. Do not create a fabric at this stage
      A7. > features:addurl mvn:net.kevinboone.apacheintegration/bndfeature/1.0.0-SNAPSHOT/xml/features
      A8. > features:install bndfeature
      A9. Check that the bundle entitled "A Camel Route" is loaded – this shows that the feature installed correctly

      B. Verify that the feature with the plain (not wrapped) bundle works in fabric mode

      B1. Create a fabric (fabric:create, etc) and a child container
      B2. Edit the feature XML file so that the <bundle> element looks like this (without the wrap: stuff)

      <bundle>mvn:net.kevinboone.apacheintegration/camelosgimaventest</bundle>

      B3. Add this feature to a profile, and add the profile to the child container, along with a profile that installs the Camel dependencies

      > container-create-child root test
      > profile-create testprofile
      > profile-edit --repositories mvn:net.kevinboone.apacheintegration/bndfeature/1.0.0-SNAPSHOT/xml/features testprofile
      > profile-edit --features bndfeature testprofile
      > container-add-profile test example-camel-autotest
      > container-add-profile test testprofile
      

      B4. Conenect to the container and verify that the "A Camel Route" bundle has been installed

      C. See that the feature with the wrapped bundle does not work in fabric mode

      C1. Create a new child container test2 (stop and remove the previous child container test if required)

      C2. Edit the feature XML file so that the <bundle> element looks like this (without the wrap: stuff)

      <bundle>wrap:mvn:net.kevinboone.apacheintegration/camelosgimaventest,file:/tmp/bnd.properties</bundle>

      Repeat step B3 with this changed bundle, to add the feature to a container

      > container-create-child root test2
      > profile-create testprofile2
      > profile-edit --repositories mvn:net.kevinboone.apacheintegration/bndfeature/1.0.0-SNAPSHOT/xml/features testprofile2
      > profile-edit --features bndfeature testprofile2
      > container-add-profile test2 example-camel-autotest
      > container-add-profile test2 testprofile2
      

      C3. Note that the container does not provision. It either gets stuck in the "Analyzing" or "Downloading" states, or there is an error message in the logs about a malformed Maven URI.

      Show
      Reproducing the profile has three parts: A. Show that wrap: with BND credentials does work outside Fabric8 B. Show that the feature we are adding does work in a Fabric8 set-up, without the use of wrap: C. Show that the feature fails in a fabric with wrap: and BND properties A. Verify that the feature with the wrapped bundle works in non-fabric mode A1. Unpack, build, and deploy featurebnd-feature.zip (mvn install) A2. Unpack, build, and deploy camelosgimvntest.zip (mvn install) A3. You may need to edit the feature XML file in the local Maven repo ( $HOME/.m2/repository/net/kevinboone/apacheintegration/bndfeature/1.0.0-SNAPSHOT/bndfeature-1.0.0-SNAPSHOT-features.xml ) so that the xmlns attribute refers to features/v1.0.0 (I seem to get v1.3.0, which does not work at all) A4. Install and start Fuse 6.2.0 A5. Create the file /tmp/bnd.properties (can be empty) A6. Do not create a fabric at this stage A7. > features:addurl mvn:net.kevinboone.apacheintegration/bndfeature/1.0.0-SNAPSHOT/xml/features A8. > features:install bndfeature A9. Check that the bundle entitled "A Camel Route" is loaded – this shows that the feature installed correctly B. Verify that the feature with the plain (not wrapped) bundle works in fabric mode B1. Create a fabric (fabric:create, etc) and a child container B2. Edit the feature XML file so that the <bundle> element looks like this (without the wrap: stuff) <bundle>mvn:net.kevinboone.apacheintegration/camelosgimaventest</bundle> B3. Add this feature to a profile, and add the profile to the child container, along with a profile that installs the Camel dependencies > container-create-child root test > profile-create testprofile > profile-edit --repositories mvn:net.kevinboone.apacheintegration/bndfeature/1.0.0-SNAPSHOT/xml/features testprofile > profile-edit --features bndfeature testprofile > container-add-profile test example-camel-autotest > container-add-profile test testprofile B4. Conenect to the container and verify that the "A Camel Route" bundle has been installed C. See that the feature with the wrapped bundle does not work in fabric mode C1. Create a new child container test2 (stop and remove the previous child container test if required) C2. Edit the feature XML file so that the <bundle> element looks like this (without the wrap: stuff) <bundle>wrap:mvn:net.kevinboone.apacheintegration/camelosgimaventest, file:/tmp/bnd.properties </bundle> Repeat step B3 with this changed bundle, to add the feature to a container > container-create-child root test2 > profile-create testprofile2 > profile-edit --repositories mvn:net.kevinboone.apacheintegration/bndfeature/1.0.0-SNAPSHOT/xml/features testprofile2 > profile-edit --features bndfeature testprofile2 > container-add-profile test2 example-camel-autotest > container-add-profile test2 testprofile2 C3. Note that the container does not provision. It either gets stuck in the "Analyzing" or "Downloading" states, or there is an error message in the logs about a malformed Maven URI.

      When a JAR is loaded into Karaf using the wrap: protocol, it is possible to specify a file containing BND properties that are to be used by Karaf to control how the OSGi bundle is created. The BND properties can be specified in a file, like this:

      wrap:mvn:mygroup/myartefact,file:/path/to/bnd.properties

      or elsewhere in a Maven repo, like this:

      wrap:mvn:mygroup/myartefact,mvn:mygroup/myartefact/bnd

      Both these variants work when loading a feature into a stand-alone Fuse; both fail when the same feature is added to a Fabric8 profile and installed in a container.

              pantinor@redhat.com Paolo Antinori
              rhn-support-kboone Kevin Boone
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: