users@jersey.java.net

[Jersey] Re: Jersey 1 client in Jersey 2 server

From: Marek Potociar <marek.potociar_at_oracle.com>
Date: Tue, 17 Jun 2014 18:05:53 +0200

Hi Jonas,

Using latest Jersey 1.x client (1.18.1) should work with Jersey 2.9 server and later (a side-effect of disabling META-INF/services scanning in Jersey 2.x by default).

You are reporting that there is some dependency from jersey 1.x client to jersey 1.x server, but I do not see that to be the case. Here's output from mvn dependency:tree for jersey 1.x client module:

[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ jersey-client ---
[INFO] com.sun.jersey:jersey-client:jar:1.19-SNAPSHOT
[INFO] +- junit:junit:jar:4.8.2:test
[INFO] +- com.sun.net.httpserver:http:jar:20070405:test
[INFO] +- org.osgi:osgi_R4_core:jar:1.0:provided
[INFO] \- com.sun.jersey:jersey-core:jar:1.19-SNAPSHOT:compile

...as you can see, there is no jersey-server dependency in the list.

HTH,
Marek

On 17 Jun 2014, at 09:24, Jonas Bergström <luckyswede_at_gmail.com> wrote:

> Hello again,
> Does anybody have any thoughts on this?
> Is upgrading to Jersey 2 just not going to work if I have dependencies that use the Jersey 1 client?
>
> / Jonas
>
>
> 2014-06-08 23:36 GMT+02:00 Jonas Bergström <luckyswede_at_gmail.com>:
> Hi,
> I'm upgrading my application from Jersey 1.x to Jersey 2.x and getting problems because a couple of my dependencies use the Jersey 1.x client and it seems impossible to run that one in a Jersey 2 server. I've tried removing the 1.x server jar but the client seems to depend on it somehow.
>
> Is there a workaround?
> Would it be possible to enhance Jersey 2 to allow 1.x on the path?
>
> My main reason for upgrading is to get async support (void method with @Suspended parameter). Are there any other ways of achieving that while staying on 1.x?
>
> Thanks / Jonas
>