3 Replies Latest reply on Mar 18, 2015 2:13 AM by grgrzybek

    Do bundles specified in a Fabric8 profile see packages of each other?

    stepin

      I specified several bundles inside of fabric8 profile. But it seems that one bundle can not use packages of another. I get an error:

      org.osgi.service.resolver.ResolutionException: Unable to resolve dummy/0.0.0: missing requirement [dummy/0.0.0] osgi.identity; osgi.identity=ru.stepin.avenue.core; type=osgi.bundle; version="[0.0.1.SNAPSHOT,0.0.1.SNAPSHOT]" [caused by: Unable to resolve ru.stepin.avenue.core/0.0.1.SNAPSHOT: missing requirement [ru.stepin.avenue.core/0.0.1.SNAPSHOT] osgi.wiring.package; filter:="(&(osgi.wiring.package=com.google.protobuf)(version>=2.5.0)(!(version>=3.0.0)))"]

       

      It is strange but exception is raised only after another profile is added to container.

      Besides packages:import command shows that my bundle ru.stepin.avenue.core actually already uses package com.google.protobuf.

      My question: Do bundles specified in a Fabric8 profile see packages of each other?

        • 1. Re: Do bundles specified in a Fabric8 profile see packages of each other?
          grgrzybek

          Hello Alexander

          osgi.wiring.package; filter:="(&(osgi.wiring.package=com.google.protobuf)(version>=2.5.0)(!(version>=3.0.0))) is is a requirement of a bundle which has to find existing capability It looks like your bundle has Import-Package: com.google.protobuf;version:=[2.5.0,3)

          You can think of Fabric8 profile as of a set of Karaf features, OSGi bundles, properties and configuration files. It's used to atomically apply a set of features/bundles/configs to container.

          So even if it manages set of bundles, it doesn't change the underlying mechanism of matching OSGi Import-Package and Export-Package

          So it looks like you just have to add protobuf bundle (mvn:com.google.protobuf:protobuf-java:2.6.1) to your profile

          best regards
          Grzegorz Grzybek

          • 2. Re: Do bundles specified in a Fabric8 profile see packages of each other?
            stepin

            Hello Grzegorz,

            But I already have in my profile mvn:com.google.protobuf/protobuf-java/2.5.0

             

            And if add my profile to a container it is installed OK.

            JBossFuse:fadmin@cont1> list

            [ 239] [Active     ] [            ] [       ] [   60] Protocol Buffer Java API (2.5.0)

            [ 246] [Active     ] [Created     ] [       ] [   60] Avenue :: Core (0.0.1.SNAPSHOT)

            JBossFuse:fadmin@cont1> packages:imports 246 | grep proto

            Protocol Buffer Java API (239): com.google.protobuf; version=2.5.0

             

            But if I afterwards add another profile to the container then it is this time server raises exception.

            I am confused and do not understand what is going on.

            • 3. Re: Do bundles specified in a Fabric8 profile see packages of each other?
              grgrzybek

              Hello Alexander

              Can you show me the definition of your profile and it's features? This "dummy/0.0.0" is a generic name used when resolving features inside profile. Even if your profile contains this bundle, it looks like it should be present inside feature defined in this profile.

              Could you share those definitions? Maybe using github?

              regards

              Grzegorz