users@jersey.java.net

[Jersey] Re: osgi issues with Jersey 2.0

From: Marek Potociar <marek.potociar_at_oracle.com>
Date: Tue, 5 Nov 2013 21:03:48 +0100

On 29 Oct 2013, at 16:12, cowwoc <cowwoc_at_bbs.darktech.org> wrote:

> On 29/10/2013 9:41 AM, phil swenson wrote:
>> are any of these issues on the roadmap? asking for another team as they say they can't upgrade to jersey 2
>>
>> Jersey 2 still does not support the equinox specific bundleentry URI which is required in order to be able to use the packages scanning capabilities of Jersey (e.g. list packages containing resources/providers in web.xml and dynamically register the containing resources/providers). The same issue was present i Jersey 1.x but there was an option to register custom URI Schema Scanner using the com.sun.jersey.core.spi.scanning.uri.UriSchemeScanner class. However, Jersey 2 has "TODO" comments for such SPIs and users are unable to register custom URI Schema Scanners. This means that equinox users cannot use the packages scanning option and should list each resource/provider explicitly.
>> As another solution for the URI issue in 2. and also for faster resources startup time in Jersey 1.x we used a CCApplication which uses WebConig and ServletContext injected with @Context. Using the injected context instances we were able to get the listed packages from web.xml and dynamically register the containing providers/resources. However, for some reason Jersey 2 cannot inject any @Context instances in ResourceConfig/Application and we cannot get access to the init-params (including the listed packages) from web.xml file.
>> OSGI JAX-RS Connector does not work in Jersey 2. Trying to access a resource fails with "java.lang.IllegalStateException: The resource configuration is not modifiable in this context.". Debugging shows that internally Jersey uses "ImmutableState" objects which cannot be modified by the OSGi JAX-RS Connector. Note that the connector works fine in Jersey 1.x.
>
> I echo Phil's sentiments. There is a long line of use-cases that used to work in 1.0 but no longer do in 2.0 (regressions). It would help to receive some official acknowledgment from the committers that these are high-priority and will be addressed before adding other functionality.


What CORE functionality is missing? Can you please send us the list?
As for contributed extensions of Jersey 1.x still missing in Jersey 2.x, we are doing as much as we can (at the fastest pace that we can), but it is certainly not the highest priority for us. We do always welcome community contributions though ;-)

>
> I don't think it makes sense to retire 1.0 until most users can reasonably upgrade to 2.0. I am dying to upgrade to Jersey 2.0 already, but my codebase simply won't run on it.

FWIW, we have not retired Jersey 1.x yet. We still actively sustain it. We are actually investing 100% of all our resources currently to slate Jersey 1.18 release in the next couple of weeks.

Marek

>
> Gili