users@jersey.java.net

[Jersey] Re: osgi issues with Jersey 2.0

From: cowwoc <cowwoc_at_bbs.darktech.org>
Date: Tue, 29 Oct 2013 11:12:24 -0400

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
>
> 1. 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.
> 2. 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.
> 3. 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.

     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.

Gili