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: 
http://old.nabble.com/invoking-a-bean-via-an-interface-in-ContentRouter-tp27197844p27197844.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to