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:08:25 +0200

Hi Jan,

Please don't use the SNAPSHOT JAX-RS 2.0 API with Jersey. Always use the stable milestone version of the JAX-RS API that we depend on in Jersey (even in snapshots). We currently depend on JAX-RS 2.0-m11 and should soon (tomorrow) depend on 2.0-m12 in our Jersey snapshot.

The reason for this fixed milestone dependency is that we need to be able to introduce breaking changes in the JAX-RS API without actually breaking Jersey code.

HTH,
Marek


On Oct 11, 2012, at 9:54 PM, Jan Algermissen <algermissen1971_at_mac.com> wrote:

> 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
>