camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zbarcea Hadrian <hzbar...@gmail.com>
Subject Re: Problem binding multiple params to a bean
Date Thu, 04 Aug 2011 13:46:47 GMT
Jason,

How is your method defined? Are you using the @Body and @Header annotations?

Hadrian


On Aug 4, 2011, at 9:00 AM, jason.parr wrote:

> 
> Hi,
> 
> Try as I might I can't bind a value associated with a header onto a bean
> reference's second method argument. Null always gets passed to the second
> argument on amendTrade(p1,p2). I can log the header value OK, the correct
> method gets called but second argument is always null.
> 
> I've tried most of the various ways that a bean can be bound to all with the
> same effect.
> 
> Route:
> 
>    from("direct:amend-bond-trade")
>      .log("direct:amend-bond-trade")
>      .to("log:showBody=false?showBodyType=true&showHeaders=true")
>      .log("Header>>>> ${header.previousVersion}")
>      .to("bean:radialTransformer?method=amendTrade(${body},
> ${header.previousVersion})")
> 
> .to("activemq:queue:nomura.fiet.stp.radial.trades?jmsMessageType=Map");
> 
> Log:
> 
> [1) thread #0 - file://src/data] route5                         INFO 
> direct:amend-bond-trade
> [1) thread #0 - file://src/data] showBody=false                 INFO 
> Exchange[ExchangePattern:InOnly,
> Headers:{previousVersion=com.nomura.fiet.stp.trademessage.BondTrade@a2d304,
> tradeEventType=AMEND}, BodyType:com.nomura.fiet.stp.trademessage.BondTrade,
> Body:com.nomura.fiet.stp.trademessage.BondTrade@14d659d]
> [1) thread #0 - file://src/data] route5                         INFO 
> Header>>>> com.nomura.fiet.stp.trademessage.BondTrade@a2d304
> [1) thread #0 - file://src/data] route7                         INFO 
> direct:error
> [1) thread #0 - file://src/data] com                            ERROR
> Exchange[Id:ID-LONWD030282-2387-1312460018181-0-8, ExchangePattern:InOnly,
> Properties:{CamelToEndpoint=log://com?level=ERROR&showAll=true,
> CamelBatchComplete=false, CamelBatchSize=3, CamelCreatedTimestamp=Thu Aug 04
> 13:13:40 BST 2011,
> CamelFailureEndpoint=bean://radialTransformer?method=amendTrade%28%24%7Bbody%7D%2C+%24%7Bheader.previousVersion%7D%29,
> CamelFileExchangeFile=GenericFile[msg2_bond_amend_10856546.xml],
> CamelBatchIndex=1, CamelExceptionCaught=java.lang.IllegalArgumentException:
> Args can't be null},
> Headers:{previousVersion=com.nomura.fiet.stp.trademessage.BondTrade@a2d304,
> tradeEventType=AMEND}, BodyType:com.nomura.fiet.stp.trademessage.BondTrade,
> Body:com.nomura.fiet.stp.trademessage.BondTrade@14d659d,
> CaughtExceptionType:java.lang.IllegalArgumentException,
> CaughtExceptionMessage:Args can't be null,
> StackTrace:java.lang.IllegalArgumentException: Args can't be null
> 	at
> com.nomura.fiet.stp.radial.BondTradeRadialTransformer.amendTrade(BondTradeRadialTransformer.java:23)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/Problem-binding-multiple-params-to-a-bean-tp4666250p4666250.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message