users@jersey.java.net

[Jersey] Re: Strange behavior with StreamingOutput as entity

From: Marek Potociar <marek.potociar_at_oracle.com>
Date: Wed, 2 May 2012 11:59:04 +0200

Hi Tatu,
can you look at the jersey-tests module and unit tests there. You should be able to use the Jersey test framework to write the unit test.

HTH,
Marek

On Apr 28, 2012, at 12:38 AM, Tatu Saloranta wrote:

> I bumped into an interesting bug (or feature?), wherein a
> StreamingOutput implementation which has at least one discoverable
> property (has a getter [and for JAXB, setter]) gets serialized as a
> POJO, instead of being handled as expected. Removing property fixes
> things.
>
> I tried debugging this with Jackson JAX-RS provider; but it should
> already be handling this case; and calling "isWritableType" on
> provider (with StreamingOutput implementation) returns false.
>
> So I am wondering if there might be different between resource methods
> that declare they return StreamingOutput; and ones that return Entity
> that contain a StreamingOutput implementation?
> This was with Jersey 1.12 (one bundled by DropWizard)
>
> I was also hoping to figure out a way to reproduce this problem,
> running some version of embedded Jersey in unit tests, but couldn't
> quite yet figure it out. If anyone has pointers to good sample code,
> please let me know. I would love to contribute a unit test, if this is
> considered a bug.
>
> -+ Tatu +-