Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JAX-RS 2.0 WebSphere 8.5 without isolated shared library

I am using Jersey 2 to implement JAR-RS 2.0 in an IBM WebSphere 8.5 environment.

After reading this post JAX-RS Jersey 2.10 support in Websphere 8 I managed to get this working.

However, is it possible to bundle the JAX-RS Jars within the WAR and deploy the application without the need to create an isolated shared library? If this is not possible, can someone please explain why this is the case?

I understand the deployment time advantage of having the Jars in a library, but I would prefer to build the entire application including dependencies into a single WAR.

-- EDIT --

It appears that you can load the JAX-RS jars from within the WAR if you change the class loading order. You need to change the order to load classes parent last. This can be done as follows;

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)".

This however suggests that some JVM properties are missing from the attached Stackoverflow article.

Can anyone shed some light on the situation?

like image 634
dooffas Avatar asked Apr 15 '15 10:04

dooffas


1 Answers

It appears that you can load the JAX-RS jars from within the WAR if you change the class loading order. You need to change the order to load classes parent last. This can be done as follows;

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)".

like image 126
dooffas Avatar answered Sep 28 '22 08:09

dooffas