Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-6625

feature:install fails for bundles with SCR Factory Components

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Feedback Received
    • 4.2.8
    • None
    • karaf
    • None

    Description

      This issue has been reported in the thread here: https://mail-archives.apache.org/mod_mbox/karaf-user/201809.mbox/%3c224b2d59-43ca-f01c-ea77-b2f7ba2a70c7@nanthrax.net%3e

      If a bundle is created using stock maven-bundle-plugin (4.2.1), without specifying:

      <_dsannotations-options>norequirements</_dsannotations-options>

      and is using Factory Components (https://osgi.org/specification/osgi.cmpn/7.0.0/service.component.html#d0e39673 , but it works the same way for R6), it results in MANIFEST.MF containing:

      Require-Capability: osgi.service;filter:="(objectClass=org.osgi.service.component.ComponentFactory)";effective:=active
      

      This is not handled properly at feature:install time and resulting in:

      karaf@root()> feature:install odl-mdsal-binding-runtime 
      org.apache.felix.resolver.reason.ReasonException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=odl-mdsal-binding-runtime; type=karaf.feature; version="[6.0.0.SNAPSHOT,6.0.0.SNAPSHOT]"; filter:="(&(osgi.identity=odl-mdsal-binding-runtime)(type=karaf.feature)(version>=6.0.0.SNAPSHOT)(version<=6.0.0.SNAPSHOT))" [caused by: Unable to resolve odl-mdsal-binding-runtime/6.0.0.SNAPSHOT: missing requirement [odl-mdsal-binding-runtime/6.0.0.SNAPSHOT] osgi.identity; osgi.identity=org.opendaylight.mdsal.binding-runtime-osgi; type=osgi.bundle; version="[6.0.0.SNAPSHOT,6.0.0.SNAPSHOT]"; resolution:=mandatory [caused by: Unable to resolve org.opendaylight.mdsal.binding-runtime-osgi/6.0.0.SNAPSHOT: missing requirement [org.opendaylight.mdsal.binding-runtime-osgi/6.0.0.SNAPSHOT] osgi.service; filter:="(objectClass=org.osgi.service.component.ComponentFactory)"; effective:=active]]
              at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1343)
              at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:392)
              at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:378)
              at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:332)
              at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257)
              at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:393)
              at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1062)
              at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998)
              at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
              at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
              at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
              at java.base/java.lang.Thread.run(Thread.java:834)
      Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve odl-mdsal-binding-runtime/6.0.0.SNAPSHOT: missing requirement [odl-mdsal-binding-runtime/6.0.0.SNAPSHOT] osgi.identity; osgi.identity=org.opendaylight.mdsal.binding-runtime-osgi; type=osgi.bundle; version="[6.0.0.SNAPSHOT,6.0.0.SNAPSHOT]"; resolution:=mandatory [caused by: Unable to resolve org.opendaylight.mdsal.binding-runtime-osgi/6.0.0.SNAPSHOT: missing requirement [org.opendaylight.mdsal.binding-runtime-osgi/6.0.0.SNAPSHOT] osgi.service; filter:="(objectClass=org.osgi.service.component.ComponentFactory)"; effective:=active]
              at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1343)
              ... 12 more
      Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve org.opendaylight.mdsal.binding-runtime-osgi/6.0.0.SNAPSHOT: missing requirement [org.opendaylight.mdsal.binding-runtime-osgi/6.0.0.SNAPSHOT] osgi.service; filter:="(objectClass=org.osgi.service.component.ComponentFactory)"; effective:=active
              at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1343)
              ... 13 more
      

      Adding above _dsannotations-options supresses the manifest entry and everything works as expected.

      Attachments

        Activity

          People

            jbonofre Jean-Baptiste Onofré
            nite Robert Varga
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: