camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <>
Subject Re: NullPointerException in ExchangeHelper.convertToType
Date Wed, 30 Jun 2010 08:08:03 GMT
Mikael Vik wrote:
> Thanks for all your help. I got the error in a testing context, and it was
> the camelContext on line 153 which was null. My bad.
> How about some more eager checking to discover if the value is null instead
> of failing in the try/catch clause in DefaultTypeConverter? For instance
> somewhere around here: 
> org.apache.camel.impl.DefaultExchange.getProperty(
> if (value == null) {
>     return null;
> }

Camel DefaultTypeConverter will turn the null value into false if the 
Type is boolean, so camel can't return the null directly.

BTW, exchange's context should not be null, I think I can add this check 
in the ExchangeHelper;

Apache Camel, Apache CXF committer
Open SOA

View raw message