camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmcb55 <>
Subject Re: Http4 component throws useless NPE if request body is String (instead of InputStream)
Date Tue, 14 Aug 2012 10:06:38 GMT
Hi Willem,

If you look again at the source code I attached (it will run as a very
simple JUnit test) - you'll see that the code gets the exception
information, but that information is a useless NullPointerException. This
exception gives no clue to the fact that the actual exception is a
type-conversion problem within the HTTP4 Camel component, caused by my code
attempting to pass a String as the message body instead of an InputStream
(so the fix was simply to wrap my String in an InputStream).

My post was just to highlight the poor error-reporting from the Camel code -
the underlying exception that describes the actual problem (a type
conversion problem) is being swallowed and our code just receives a
meaningless NPE exception instead (meaning we had to trace down into the
guts of the Camel implementation to actually discover the real problem).



View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message