You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Benson Margulies <bi...@gmail.com> on 2013/02/26 15:08:14 UTC

JAX-RS handling an exception in the middle of an output writer

So, I've absently-constructed the following problem.

I've got a JAX-RS service that does, essentially, all of its work in a
StreamingOutput object. It also has an error mapper that produces a
Json body to go with the 400 status code in the error response.

You can see where this goes: the code succeeds in writing *some* of
the output, encounters an exception, and then sets up the error
response. CXF dutifully serializes it, resulting in a mess consisting
of the beginning of the original output followed by the error output.

Is this a CXF problem? Does the standard offer any guidance?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: JAX-RS handling an exception in the middle of an output writer

Posted by Benson Margulies <bi...@gmail.com>.
That's true. I obviously wasn't awake.

On Tue, Feb 26, 2013 at 9:15 AM, Stephen Connolly
<st...@gmail.com> wrote:
> This is not a Maven problem...
>
>
> On 26 February 2013 14:08, Benson Margulies <bi...@gmail.com> wrote:
>
>> So, I've absently-constructed the following problem.
>>
>> I've got a JAX-RS service that does, essentially, all of its work in a
>> StreamingOutput object. It also has an error mapper that produces a
>> Json body to go with the 400 status code in the error response.
>>
>> You can see where this goes: the code succeeds in writing *some* of
>> the output, encounters an exception, and then sets up the error
>> response. CXF dutifully serializes it, resulting in a mess consisting
>> of the beginning of the original output followed by the error output.
>>
>> Is this a CXF problem? Does the standard offer any guidance?
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: JAX-RS handling an exception in the middle of an output writer

Posted by Stephen Connolly <st...@gmail.com>.
This is not a Maven problem...


On 26 February 2013 14:08, Benson Margulies <bi...@gmail.com> wrote:

> So, I've absently-constructed the following problem.
>
> I've got a JAX-RS service that does, essentially, all of its work in a
> StreamingOutput object. It also has an error mapper that produces a
> Json body to go with the 400 status code in the error response.
>
> You can see where this goes: the code succeeds in writing *some* of
> the output, encounters an exception, and then sets up the error
> response. CXF dutifully serializes it, resulting in a mess consisting
> of the beginning of the original output followed by the error output.
>
> Is this a CXF problem? Does the standard offer any guidance?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>