Hi Mike,
Can you share the client code?
If you are defining in a get say a list of JAXB beans then the client
will never return null, it will always expect some content to be
returned. You need to express the requirements that you may or may not
have an entity by wrapping the type in an EntityHolder, see:
https://jersey.dev.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/core/provider/EntityHolder.html
Hth,
Paul.
On Aug 4, 2010, at 4:40 PM, Mike Baranczak wrote:
> I'm using Jersey 1.1.5 inside Glassfish 3. I have a resource method
> that returns a collection object, but sometimes it returns null;
> this is the desired behavior, it just indicates that it has no data
> to send. The Jersey server deals with this by sending a response
> with an empty body and a status of "204 No Content". So far so good
> - but the Jersey client throws a UniformInterfaceException when it's
> expecting some data in the response and gets a 204 instead.
>
> Should this be considered a bug in the Jersey client?
>
> Is there any way to work around this (I don't want to send an empty
> non-null collection, since within my application this would mean
> something different than a null response)?
>
> -MB
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>