camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: invoking a bean via an interface in ContentRouter
Date Sun, 17 Jan 2010 11:39:46 GMT

I think you need to add that Spring snippet for letting it scan classes as well

Its something like this. Check the Spring documentation.

On Sun, Jan 17, 2010 at 12:21 PM, ee7arh <> wrote:
> Hi,
> I would like to invoke methods in my pojo classes from the ContentRouter
> where the bean is an interface. However I get the error:
> org.apache.camel.NoSuchBeanException: No bean could be found in the registry
> for: serviceEventHandler
> I have an interface with the @Service annotation at the top as so:
> @Service(value = "serviceEventHandler")
> public interface ServiceEventHandler {
>    public void registerServiceEvent(ServiceEvent serviceEvent);
> Then I have 2 classes which implement this interface, both of which do not
> have the @Service annotation at the top (although I tried adding the
> annotation there too but ran into duplicate bean problems).
> Then in my Camel route I want to have:
>               .to("bean:serviceEventHandler?method=registerServiceEvent")
> And based on the type of object coming through the route I would hope that
> the correct subclass is called. However it looks like the package-scan does
> not setup this interface as a bean or try to setup the subclasses as I get
> the above error.
> Perhaps this is something which is fundamentally not possible with beans but
> it would be nice.
> Thanks
> Andrew
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Apache Camel Committer

Author of Camel in Action:
Open Source Integration:

View raw message