JAX-RS Jersey 2.10 support in Websphere 8

You need to do the following steps:

Disable built in JAX-RS via JVM property com.ibm.websphere.jaxrs.server.DisableIBMJAXRSEngine=true see description here.
You can set this property via web admin console in Servers > WebSphere Application Servers > yourServerName. Then in Server Infrastructure section Java and Process Management > Process definition > Java Virtual Machine > Custom properties.

Create isolated shared library with all JAX-RS 2.10 libraries, in console via Environment > Shared Libraries.

Isolated shared library is created via checking Use an isolated class loader for this shared library Class Loading option, when creating library.

Map this shared library to your application, either during installation or later on, via Applications > appName > Shared library references.

Restart application server. In the SystemOut.log you should see message initializing JAX-RS classes:

[7/12/14 16:10:36:470 CEST] 0000004a JerseyServlet I   Registering the Jersey servlet application, named javax.ws.rs.core.Application, with the following root resource and provider classes: [class jax.Hello, class org.glassfish.jersey.server.wadl.internal.WadlResource]
[7/12/14 16:10:36:688 CEST] 0000004a ApplicationHa I   Initiating Jersey application, version Jersey: 2.10.1 2014-06-30 13:53:32...

UPDATE

It appears that it is also possible to load the JAX-RS jars from within the WAR. You have to set this DisableIBMJAXRSEngine property and you need to change the class loading option in the module (not on EAR level) classloader to Classes loaded with local class loader first (parent last)

In the admin console:

Applications > WebSphere Enterprise Applications > {your.application} > Manage Modules > {your.module}

Change the Class loader order dropdown to: Classes loaded with local class loader first (parent last).

Thanks for dooffas for checking it, see JAX-RS 2.0 WebSphere 8.5 without isolated shared library

Leave a Comment