Unfortunately, Jersey 2 is not compatible with GF 3.x. We also have no immediate plans to make it compatible.
Jersey 1.x is tightly integrated and used by GF 3.x internals. As such, JAX-RS runtime is (unfortunately) statically initialized using a shared GF class loader making it practically infeasible to support Jersey 2 at the moment. A patch would be very costly. As such, trying to use Jersey 2.x on GF 3.x is a bad idea that would most likely lead to server and application instabilities or undefined application behavior.
To use Jersey 2, please switch to GF 4 or wait for the upcoming WLS 12.1.3 release. WLS with it's concept of filtering class loaders and shared libraries makes it possible to support JAX-RS 2.0 and Jersey 2.x selectively per-application. As such WLS 12.1.3 will support both JAX-RS/Jersey 1.x and JAX-RS/Jersey 2.x.
Marek
On Oct 15, 2013, at 8:18 AM, Kristian Rink <kr_at_zimmer428.net> wrote:
> Folks;
>
> is it possible or a smart idea to run Jersey 2.x on a Glassfish 3.1.2 installation, bundled in a war module? I would like to upgrade to JAX-RS 2.x yet I can't yet move on to Glassfish 4.x so I quickly wanted to check back here to get an idea whether this is a smart move or whether I'd rather wait and move to Jersey 2.x all along with upgrading to Glassfish 4 in near future?
>
> TIA and all the best,
> Kristian