Hi Bill,
I'm assuming that you are trying to call
exchange.getOut().getBody().getClass() in your bean method.
Can you change the code to exchange.getIn().getBody().getClass() ?
Willem
On 3/2/11 2:09 PM, Bill wrote:
Hi,
My camel version is 2.6 . and I switch to 2.5 , The result is the same as
before.
when I use exchange.getOut().getBody().getClass() is throws a
NullPointerException .
There are something very oddly.
-----when I use logger.info(exchange); it prints infomation from my database
just like :Exchange[JmsMessage: [{FID=abc1 1956028776, FNUMBER=fff,
FCOUNT=1956028776}, .........]]
-----but when I use logger.info(exchange.getOut()); it prints : JmsMessage:
null
And I trace the debug of this code: when calling exchange.getOut(), It calls
org.apache.camel.impl.DefaultExchange.getOut() , the codes as follows:
------------------------------------------------------------
if (out == null) {
out = (in != null&& in instanceof MessageSupport)
? ((MessageSupport)in).newInstance() : new DefaultMessage();
configureMessage(out);
}
------------------------------------------------------------
so It return a new JmsMessage(null, binding)
--
View this message in context:
http://camel.465427.n5.nabble.com/why-camel-jdbc-do-not-return-an-ArrayList-tp3406057p3406157.html
Sent from the Camel - Users mailing list archive at Nabble.com.
--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang