users@jersey.java.net

null return values versus Content-Type header

From: <FSauer_at_dsthealthsolutions.com>
Date: Tue, 27 May 2008 13:47:46 -0500

What is the recommended way to allow null return values (resulting in a
204 status) but still have the
@ProduceMime annotation, without running into the following exception?

Thanks,

Frank Sauer


The "Content-Type" header is set to application/xml, but the response has
no entity:

javax.ws.rs.WebApplicationException
        at
com.sun.ws.rest.impl.uri.rules.HttpMethodRule.verifyResponse(HttpMeth
odRule.java:209)
        at
com.sun.ws.rest.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.j
ava:113)
        at
com.sun.ws.rest.impl.uri.rules.RightHandPathRule.accept(RightHandPath
Rule.java:88)
        at
com.sun.ws.rest.impl.uri.rules.ResourceClassRule.accept(ResourceClass
Rule.java:55)
        at
com.sun.ws.rest.impl.uri.rules.RightHandPathRule.accept(RightHandPath
Rule.java:88)
        at
com.sun.ws.rest.impl.uri.rules.RootResourceClassesRule.accept(RootRes
ourceClassesRule.java:49)
        at
com.sun.ws.rest.impl.application.WebApplicationImpl.handleRequest(Web
ApplicationImpl.java:369)
        at
com.sun.ws.rest.spi.container.servlet.ServletContainer.service(Servle
tContainer.java:130)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


-----------------------------------------
This e-mail and any attachments are intended only for the
individual or company to which it is addressed and may contain
information which is privileged, confidential and prohibited from
disclosure or unauthorized use under applicable law. If you are
not the intended recipient of this e-mail, you are hereby notified
that any use, dissemination, or copying of this e-mail or the
information contained in this e-mail is strictly prohibited by the
sender. If you have received this transmission in error, please
return the material received to the sender and delete all copies
from your system.