users@jersey.java.net

[Jersey] Re: Jersey 2.0-m08: troubleshooting and dependencies

From: Marek Potociar <marek.potociar_at_oracle.com>
Date: Thu, 11 Oct 2012 23:18:03 +0200

If the problem is in the Java to XML or JSON binding, you may need to configure logging for the binding provider libraries (JAXB RI from Java SE and/or Jackson in your case).

Jersey does not have any influence on the internal details, processing and logging done by the libraries.

Marek

On Oct 11, 2012, at 9:42 PM, Marko Asplund <marko.asplund_at_gmail.com> wrote:

> hi,
>
> I started testing Jersey 2.0-m08 milestone release.
> My resource classes are returning JAXB classes that Jersey serializes to XML or JSON depending on the Accept-header value.
> At some point request processing was failing due to application bugs: the JAXB class was missing a no-arg constructor and later the JSON jars required by Jersey were missing.
> I configured Jersey to log at FINEST level via java.util.logging but I couldn't find any clues from the log.
> The application was failing silently in these cases which made troubleshooting a bit difficult.
> The problem is solved now but how do you have any troubleshooting tips for this sort of issues?
> I think it might be good to add a few notes about configuring Jersey logging to a troubleshooting section of the user guide.
>
> Which Jersey dependencies should I specify for my application in Maven?
> The following specification seems to be working but is it optimal?
> I'm deploying the app to a Servlet 3.0 container (Jetty 8.1).
>
> <dependency>
> <groupId>javax.ws.rs</groupId>
> <artifactId>javax.ws.rs-api</artifactId>
> <version>${jax-rs-api.version}</version>
> <scope>compile</scope>
> </dependency>
>
> <dependency>
> <groupId>org.glassfish.jersey</groupId>
> <artifactId>jax-rs-ri</artifactId>
> <version>${jersey.version}</version>
> <scope>runtime</scope>
> </dependency>
>
> <dependency>
> <groupId>org.glassfish.jersey.core</groupId>
> <artifactId>jersey-common</artifactId>
> <version>${jersey.version}</version>
> <scope>runtime</scope>
> </dependency>
>
> <dependency>
> <groupId>org.glassfish.jersey.media</groupId>
> <artifactId>jersey-media-json-jackson</artifactId>
> <version>${jersey.version}</version>
> <scope>runtime</scope>
> </dependency>
>
>
> marko