camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig Taylor <ctalk...@ctalkobt.net>
Subject Re: Issue w/ multi-parameter bean methods
Date Sun, 19 Dec 2010 22:00:18 GMT
I've gotten around the problem by turning it into a processor but the route
was pro grammatically generated as

from( "file:/home/myuser/data/in")
   .to( "bean:myLogger?method=logStart" )
   .process( processor1 )
   .to( "bean:myLogger?method=logEnd" );

I'll try and come up with an isolated test case I can post to later.

On Sat, Dec 18, 2010 at 6:23 AM, Claus Ibsen <claus.ibsen@gmail.com> wrote:

> Can you post Camel version used and the route you are using?
>
>
> On Fri, Dec 17, 2010 at 6:42 PM, Craig Taylor <ctalkobt@ctalkobt.net>
> wrote:
> > I'm attempting to fire a bean method "logStart" and am receiving a
> > conversion error as it appears it's treating my initial integer parameter
> as
> > the body.  From trace logs:
> >
> > 12:33:17,297 | TRACE | tenerContainer-1 | BeanInfo
>   |
> > he.camel.component.bean.BeanInfo  296 | Creating MethodInfo for class:
> class
> > $Proxy187 method: public final void
> > $Proxy187.logStart(java.lang.Integer,java.lang.Strin
> > 12:33:17,297 | TRACE | tenerContainer-1 | BeanInfo
>   |
> > he.camel.component.bean.BeanInfo  307 | Parameter #0:
> ParameterInfo[index=0,
> > type=class java.lang.Integer, annotations=[], expression=null]
> > 12:33:17,297 | TRACE | tenerContainer-1 | BeanInfo
>   |
> > he.camel.component.bean.BeanInfo  328 | Parameter #0 is the body
> parameter
> > using expression mandatoryBodyAs[java.lang.Integer]
> > 12:33:17,297 | TRACE | tenerContainer-1 | BeanInfo
>   |
> > he.camel.component.bean.BeanInfo  337 | Parameter #0 has parameter info:
> > ParameterInfo[index=0, type=class java.lang.Integer, annotations=[],
> > expression=mandatoryBod
> > 12:33:17,298 | TRACE | tenerContainer-1 | BeanInfo
>   |
> > he.camel.component.bean.BeanInfo  307 | Parameter #1:
> ParameterInfo[index=1,
> > type=class java.lang.String, annotations=[], expression=null]
> > 12:33:17,298 | TRACE | tenerContainer-1 | BeanInfo
>   |
> > he.camel.component.bean.BeanInfo  337 | Parameter #1 has parameter info:
> > ParameterInfo[index=1, type=class java.lang.String, annotations=[],
> > expression=null]
> > 12:33:17,298 | TRACE | tenerContainer-1 | MethodInfo
>   |
> > .camel.component.bean.MethodInfo  220 | Creating parameters expression
> for 2
> > parameters
> > 12:33:17,298 | TRACE | tenerContainer-1 | MethodInfo
>   |
> > .camel.component.bean.MethodInfo  228 | Parameter #0 has expression:
> > mandatoryBodyAs[java.lang.Integer]
> > 12:33:17,298 | TRACE | tenerContainer-1 | MethodInfo
>   |
> > .camel.component.bean.MethodInfo  228 | Parameter #1 has expression: null
> >
> > where my function definition is :
> >
> > @Handler
> >    public void logStart( @Header("MY_ID") Integer myId,
> > @Header("CamelFileName") String filename )
> >
> > Changing the Integer myId, and the associated setHeader to strings
> > apparently causes this to work.  I'd much prefer to use an integer id
> rather
> > than a string.
> >
> >
> > --
> > -------------------------------------------
> > Craig Taylor
> > ctalkobt@ctalkobt.net
> >
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>



-- 
-------------------------------------------
Craig Taylor
ctalkobt@ctalkobt.net

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