users@jersey.java.net

Re: [Jersey] can't output json

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Fri, 10 Jul 2009 10:54:12 +0200

On Jul 9, 2009, at 11:35 PM, Jesus M. Rodriguez wrote:

> I've been racking my brain trying to figure out why simple JSON output
> doesn't work for me.
> I'm getting this error:
>
> SEVERE: A message body writer for Java type, class
> org.fedoraproject.candlepin.model.User, and MIME media type,
> application/json, was not found
>

What are you dependencies?

Please take note of the dependences in the following:

https://jersey.dev.java.net/source/browse/*checkout*/jersey/tags/jersey-1.1.0-ea/jersey/dependencies.html

Goto the JAXB section and take note of the JSON related dependencies
that are required.


> Full stack trace here: http://pastie.org/540558
>
> Also, how do you increase the logging of jersey?
>

If you increase the JDK default logging output to CONFIG you may get
some additional output that will tell if certain components could not
be created due to failed dependencies.

Paul.