users@jersey.java.net

[Jersey] Jersey 2.0-m08: troubleshooting and dependencies

From: Marko Asplund <marko.asplund_at_gmail.com>
Date: Thu, 11 Oct 2012 22:42:14 +0300

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