Hi

Yeah calculateFooHeaderValue() means the no-arg method.
So you should remove the () to let Camel pick any of the methods with
that name, that fits the best.

On Thu, Jan 30, 2014 at 6:15 PM, toomanyedwards
<[email protected]> wrote:
> Hi all,
>   We are attempting to upgrade from Camel to 2.10 to Camel 2.12, but are
> experiencing what appears to be a backwards incompatibility in the bean
> method parameter mapping between 2.10 and 2.12.  Here's a distilled version
> of the issue.  We have routes with Java DSL that so do something like the
> following:
>    ...
>    setHeader("FOO").method(SomeBean.class,"calculateFooHeaderValue()")
>    ...
>
> Our SomeBean class looks like the following:
>
>   public class SomeBean
>   {
>       ...
>      public static String calculateFooHeaderValue(@Header("BAR) String
> barHeaderValue)
>     {
>          ...
>     }
>
>      ...
>   }
>
> Camel 2.10 understands that we want to invoke the calculateFooHeaderValue
> method with BAR header bound to the barHeaderValue parameter.  However, with
> Camel 2.12 we get the following runtime exception:
>
> org.apache.camel.component.bean.MethodNotFoundException
> Method with name: calculateFooHeaderValue() (with no parameters) not found
> on bean:...
>
> Looks like Camel 2.12 thinks we want to invoke a method with no params
> (which we don't have). It appears a work around for this incompatibility is
> for us to specify something like:
>
>    setHeader("FOO").method(SomeBean.class,"calculateFooHeaderValue(*)")
> or
>    setHeader("FOO").method(SomeBean.class,"calculateFooHeaderValue(String)")
>
> BUT
>   both of those would require code changes for us to be able to upgrade to
> Camel 2.12.  Is this really a backwards incompatibility between 2.10 or
> 2.12?  Is there any work around that doesn't involve us having to change all
> of our routes that use this functionality?
>
> Any insight is appreciated.  Thanks!
>
> -edward
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Breaking-change-is-bean-parameter-binding-from-Camel-2-10-to-2-12-tp5746630.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: [email protected]
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io

Reply via email to