I found the skipBindingOnErrorCode(false) option in restConfiguration. This solved the first problem at least.
On 9 February 2016 at 13:45, Matt Sicker <boa...@gmail.com> wrote: > I'm using the rest-dsl in Camel 2.16.2. On each rest route, I use > consumes("application/json") and produces("application/json"). I am using > RestBindingMode.json. However, I have gotten some strange HTTP responses > when I use a non-2xx status code. For instance, I have an error message > POJO that corresponds to the JSON data for our error response. I'll set the > message body to this object. This object is Serializable and sent over > ActiveMQ. The response I'm getting is not JSON data and in fact looks > strangely like the toString() output of this class. > > I've had a similar problem where a class we're using has both JAXB and > Jackson annotations on it and in a case where the status code was set to > 500 (caused by an exception thrown during a multicast) and the response was > marshalled as XML instead of JSON. > > I'd like to know if this is a known issue or something that was already > fixed in master before I try to make a minimal reproduction of the bug. Or > maybe I'm doing something wrong? > > -- > Matt Sicker <boa...@gmail.com> > -- Matt Sicker <boa...@gmail.com>