Hi Andrei,

Service and reference are decoupled as they are in different bundles (most of 
the time).

If you want to « link » via serviceName, just use properties and filter:

<service ….>
        <service-properties>
           <entry key=“id” value=“serviceName”/>
        </service-properties>
</service>

Then:

<reference … filter=“(id=serviceName)”/>

Regards
JB

> Le 21 sept. 2021 à 10:44, Andrei Petru Mura <[email protected]> a écrit :
> 
> I have my own bundle deployed in karaf 4.3.2.
> 
> In my blueprint.xml, I have declared a few services, like this:
> 
> <service id="serviceName" interface="some.InterfaceName" 
> ref="importedSpringBeanName" />
> 
> If I list the services in karaf, I can see that this services are available.
> 
> In another bundle, I want to use this services via reference. Like this:
> 
>   <reference id="referencedServiceName" component-name="serviceName" 
> interface="some.InterfaceName" />
> 
> But when I deploy my second bundle in karaf, I get this:
> Unable to start container for blueprint bundle my-second-bundle/0.0.1 due to 
> unresolved dependencies 
> [(&(objectClass=some.InterfaceName)(osgi.service.blueprint.compname=serviceName))]
> 
> Am I missing something? Is there a way to reference a service via its ID?
> 
> Thanks,
> Andrei

Reply via email to