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?
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)".
来源:https://stackoverflow.com/questions/29647920/jax-rs-2-0-websphere-8-5-without-isolated-shared-library