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

Using a SCR Component ref. for blueprint managed beans

    XMLWordPrintableJSON

    Details

    • Type: Question
    • Status: Resolved
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 4.2.6
    • Fix Version/s: None
    • Component/s: karaf
    • Labels:
      None

      Description

      Hello,

      in a Blueprint managed bean, I want to inject a SCR managed component/service. Example codebase is here: https://github.com/timoe/karaf-4-playground/tree/blueprint-consumer.

      There is a BluePrintConsumer type which is bootstrapped by a Blueprint XML config. This injects a SCR component via

      <reference id="singleInstanceResponderImpl"
      		interface="karafplayground.interface1.SingleInstanceResponder" />
      

      (see karafplayground.interface1.impl.SingleInstanceResponderImpl type).

      BluePrintConsumer is part of a feature feature-2. Once this feature is loaded it fails with

      Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=playground-feature-2; type=karaf.feature; version="[0.0.1.SNAPSHOT,0.0.1.SNAPSHOT]"; filter:="(&(osgi.identity=playground-feature-2)(type=karaf.feature)(version>=0.0.1.SNAPSHOT)(version<=0.0.1.SNAPSHOT))" [caused by: Unable to resolve playground-feature-2/0.0.1.SNAPSHOT: missing requirement [playground-feature-2/0.0.1.SNAPSHOT] osgi.identity; osgi.identity=karaf4-playground.playground-api-blueprint; type=osgi.bundle; version="[0.0.1.SNAPSHOT,0.0.1.SNAPSHOT]"; resolution:=mandatory [caused by: Unable to resolve karaf4-playground.playground-api-blueprint/0.0.1.SNAPSHOT: missing requirement [karaf4-playground.playground-api-blueprint/0.0.1.SNAPSHOT] osgi.service; effective:=active; filter:="(objectClass=karafplayground.interface1.SingleInstanceResponder)"]]
      

      I'm using

      • maven-scr-plugin:1.26.2
      • maven-bundle-plugin:4.2.1

      Features aries-blueprint and deployr are installed.

        Attachments

          Activity

            People

            • Assignee:
              jbonofre Jean-Baptiste Onofré
              Reporter:
              timo.e.aus.e Timo E aus E
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: