On Fri, Oct 2, 2009 at 11:27 AM, Jussi Nummelin
<[email protected]> wrote:
> Hi,
>
> We're hitting a bit peculiar Camel problem.
>
> We have our Camel route defined like this:
> <bean id="enricher" class="SomeBean"/>
>
>  <camelContext id="camelContext" useJmx="true"
> xmlns="http://activemq.apache.org/camel/schema/spring";>
>
>  <route>
>        <from uri="jbi:service:Notification"/> <!-- the "sender" endpoint,
> e.g. a file poller -->
>        <bean ref="enricher" method="processExchange"/>
>        <to uri="jbi:service:Test" />
>  </route>
>
>
> So in practice what we want to do is to "enrich" the message before
> giving it to another component.
>
> For some reason the call to our enricher bean fails with this message:
> org.apache.camel.component.bean.AmbiguousMethodCallException:
> Ambiguous method invocations possible: [public static void
> SomeBean.print(javax.xml.transform.Source), public void
> SomeBean.setDbServiceName(java.lang.String)] on the exchange:
> Exchange[JbiMessage:
> org.apache.servicemix.jbi.messaging.normalizedmessagei...@dbe4e5]
>
> Does this mean that what ever message we're passing is actually a
> String object and thus Camel is trying to select a suitable void
> xxx(String arg) type of method? As we have the method defined in the
> route, why is Camel overriding it?
>
> Our processing method signature is:
> public void processExchange(org.apache.camel.Exchange exchange);
>
> Any help appreciated.
>
>
> Cheers,
> - Jussi -
>

I assume you are using Camel 1.x which have a bug where even the
method="xxx" does not always pick this method.
Its fixed in 2.0 and maybe the latest 1.x as well (cant remember).

You can work around this by having a single method in your bean or use
a Processor instead.


-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Reply via email to