Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

Lately (2.14) NullPointerExceptions instead of TypeConversionExceptions

$
0
0
Some day ago i switched to camel 2.14 (mainly because of RoutePolicyFactory -
a great idea!). But i also noticed on creating new routes with new
processors/ aggregators i see many NullPointerExceptions in lines that use
object from exchange.getIn().getBody(Some.class).
In those cases the body was never empty (debugged it) but the type
conversion was not possible. As soon as i use the correct type or use it
without class parameter the NPEs are gone.

The problem is that i often catch the TypeConversionException and rethrow it
to give additional info. Should i change that code and catch NPE instead?
Could this be related with 2.14?

Thanks in advance

Viewing all articles
Browse latest Browse all 5648

Trending Articles