On Sun, Mar 17, 2013 at 10:41 AM, Reto Bachmann-Gmür <[email protected]> wrote:
> Hi Luciano
>
> The error occurs when the resource method has no @Produces (or
> @Produces(*/*) ) and there is no MessageBodyWriter for the first preference
> in the Accept header.
>
> Cheers,
> Reto
>
I have created a simple sample application to try to reproduce your
problem, see [1]. In this application, I defined a simple resource :
@Path("/wink379")
public class Resource {
@GET
@Produces(MediaType.MEDIA_TYPE_WILDCARD)
public Response getAll() { ... }
}
And then created a simple message body writer that just output some value back.
public void writeTo( ... ) throws IOException, WebApplicationException {
entityStream.write("Response generated by
ResourceMessageBodyWritter".getBytes());
}
Then used a chrome rest client extension to submit a request like :
GET http://localhost:8080/sample-jaxrs-webapp/services/wink379
Content-Type application/json
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Authorization xxxxx
And I get back the result from the writer :
Response generated by ResourceMessageBodyWritter
Could you please check my sandbox project and see what's different
from your scenario, and help me reproduce your issue.
[1] https://svn.apache.org/repos/asf/wink/sandbox/lresende/sample-jaxrs-webapp/
--
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/