users@jersey.java.net

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

From: Jan Algermissen <algermissen1971_at_mac.com>
Date: Thu, 11 Oct 2012 21:54:45 +0200

Hi all,

I am also having troubles since today (though it might be due to a lack of mvn mastery). Here is my POM

<repositories>
 <repository>
  <id>snapshot-repository.java.net</id>
  <name>Java.net Snapshot Repository for Maven</name>
  <url>https://maven.java.net/content/repositories/snapshots/</url>
  <layout>default</layout>
 </repository>
</repositories>

    <dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-web-api</artifactId>
            <version>6.0</version>
            <scope>provided</scope>
        </dependency>
     
<dependency>
 <groupId>javax.ws.rs</groupId>
 <artifactId>javax.ws.rs-api</artifactId>
 <version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
 <groupId>org.glassfish.jersey.core</groupId>
 <artifactId>jersey-client</artifactId>
 <version>2.0-SNAPSHOT</version>
</dependency>
</dependencies>

I am having, for example, problems with getCookies on Response:

[ERROR] symbol : method getCookies()
[ERROR] location: class javax.ws.rs.core.Response


Jan



On Oct 11, 2012, at 9:42 PM, Marko Asplund 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