camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Moulliard <cmoulli...@gmail.com>
Subject Re: How to avoid a org.apache.camel.component.bean.AmbiguousMethodCallException when calling methods of a Bean component
Date Tue, 14 Jul 2009 09:00:45 GMT
Even If I add the annotation @Handler on the two methods with the same name,
the error is generated

Exception: org.apache.camel.component.bean.AmbiguousMethodCallException:
Ambiguous method invocations possible: [public java.util.List
com.xpectis.x3s.core.util.ServiceHelper.updateRequestStatus(java.lang.String,java.lang.String,java.util.List),
public void
com.xpectis.x3s.core.util.ServiceHelper.updateRequestStatus(java.lang.String,java.lang.String,java.lang.String,org.apache.camel.Exchange)]

Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer

*****************************
blog : http://cmoulliard.blogspot.com


On Tue, Jul 14, 2009 at 10:27 AM, Claus Ibsen <claus.ibsen@gmail.com> wrote:

> On Tue, Jul 14, 2009 at 10:25 AM, Charles Moulliard<cmoulliard@gmail.com>
> wrote:
> > Hi,
> >
> > Is there any other workaround except renaming the method "updatStatus" to
> > avoid to have an error : AmbiguousMethodCallException.
> >
> > In my example, I would like to allow to have two methods with the same
> name
> > but having different input parameters and return type
> >
> > Here is the route that I want to use :
> >
> > from(file)
> > .to(beanA) // Create Request
> > .to(beanB) // parse request
> > .to(queueA)
> >
> > from(queueA)
> > .to(beanC) // validate request
> > .to(beanD method="updateStatus") // update Status (input parameter : Body
> =
> > Request.class, return type = void)
> > .to(queueB)
> >
> > ...
> >
> > from(queueX)
> > .to(beanX)
> > .to(beanD method="updateStatus") // update Status (input parameter : Body
> =
> > Report.class, Header "requestId" String request ID, return type = void)
> >
> > Is it possible ?
> >
>
> Add @Handle to the method you want Camel to choose.
>
>
> > Regards,
> >
> > Charles Moulliard
> > Senior Enterprise Architect
> > Apache Camel Committer
> >
> > *****************************
> > blog : http://cmoulliard.blogspot.com
> >
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message