You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Jörg Jansen <Jo...@inform-software.com> on 2020/10/14 12:09:56 UTC

@BeanInject in OSGI-container

Hi everybody,

not sure if this is the correct channel.
If not, please let me know.

I'm running camel (3.5.0) in a karaf container (4.2.9).
There I have one bundle which provides a special service (IServiceModelFactory).

Blueprint:
<service id="gs-model-factory-intf" ref="gs-model-factory" interface="aero.groundstar.gslisa.base.component.gs.api.factory.IServiceModelFactory" />
<bean id="gs-model-factory" class="aero.groundstar.gslisa.base.component.gs.impl.factory.GsModelFactoryImpl" scope="singleton"/>

Visible in container:
karaf@root()> service:list aero.groundstar.gslisa.base.component.gs.api.factory.IServiceModelFactory
[aero.groundstar.gslisa.base.component.gs.api.factory.IServiceModelFactory]
---------------------------------------------------------------------------
osgi.service.blueprint.compname = gs-model-factory
service.bundleid = 300
service.id = 1089
service.scope = bundle
Provided by :
GS-LISA :: COMPONENT :: GS-SERVICES :: GS-MODEL-IMPL (300)


The other module is referencing to this service:

Blueprint:
<reference id="gs-model-factory" interface="aero.groundstar.gslisa.base.component.gs.api.factory.IServiceModelFactory" />

But when I try to inject this service into another bean, this could not be resolved, because there are two beans available within the CamelContext.
One is the service itself, the other on a proxy object of this service.
Is there a way, to disable the proxy or is there another approach to do?
Kind regards,
Jörg