camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Referencing OSGi services with RouteBuilder classes for use in CamelContext
Date Mon, 02 Sep 2013 13:35:48 GMT
I was able to reproduce the issue and logged a ticket
https://issues.apache.org/jira/browse/CAMEL-6699

On Mon, Sep 2, 2013 at 1:19 PM, Claus Ibsen <claus.ibsen@gmail.com> wrote:
> Hi
>
> Do you have the stacktrace for this?
>
> Not sure why blueprint gives you the proxy class, could be that the
> osgi registry in camel-core-osgi should detect its a proxy class and
> get the target class automatic. But a stacktrace / or sample project
> to reproduce would be lovely to play with.
>
> On Mon, Jun 24, 2013 at 2:20 PM, Martin Stiborsk√Ĺ
> <martin.stiborsky@gmail.com> wrote:
>> Hello guys,
>> I'd like to ask first if I'm wrong or not...
>> I have a bundle, where is defined CamelContext in blueprint XML. In
>> this XML, I'd like to reference services from n other bundles, which
>> exposes services with routes - RouteBuilder class(es).
>>
>> How should be the route class for the bundles exposed? Something like this (?):
>>
>> <bean id="myRoute" class="com.foo.MyRoute"/>
>> <service ref="myRoute" interface="org.apache.camel.RoutesBuilder"/>
>>
>> Then, in the "main" bundle, where is CamelContext defined, I can catch
>> the reference:
>>
>> <reference id="myRouteReference" component-name="myRoute"
>> interface="org.apache.camel.RoutesBuilder"/>
>>
>> The problem is, it kind of doesn't work for me :(
>> The service is exposed, the reference is not null, but class type is wrong:
>>
>> Caused by: org.apache.camel.NoSuchBeanException: Found bean:
>> avatarRoutes in BlueprintContainer:
>> org.apache.aries.blueprint.container.BlueprintContainerImpl@50a28
>> b65 of type: Proxybad2ac0c_5c42_4054_bf65_7566a287f4c8 expected type
>> was: class org.apache.camel.builder.RouteBuilder
>>
>> Camel 2.11 / Karaf 2.3.1
>> According this answer from Claus
>> (http://stackoverflow.com/a/13439844/805219) I guess the idea is
>> possible, just my implementation is wrong.
>>
>> --
>> S pozdravem / Best regards
>> Martin Stiborsk√Ĺ
>>
>> Jabber: stibi@njs.netlab.cz
>> Twitter: http://www.twitter.com/stibi
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: cibsen@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Mime
View raw message