Rest - Jersey with Glass Fish12.1. Overriding Jersey with war files To override the version of Jersey distributed in GlassFish with a version of Jersey distributed in a war file ensure that class loader delegation is set to false in WEB-INF/sun-web.xml or WEB-INF/glassfish-web.xml. For example:
<sun-web-app error-url="">
<context-root>/context</context-root> <class-loader delegate="false"/> </sun-web-app> In the GlassFish admin console, go to Configuration->JVM Settings, switch to the JVM Options tab and add the following option:
-
Dcom.sun.enterprise.overrideablejavaxpackages=javax.ws.rs,javax.ws.rs.core, javax.ws.rs.ext Restart GlassFish for new JVM settings to take effect. 12.2. Upgrading Jersey in GlassFish 12.2.1. GlassFish v3.0 and 3.0.1 GlassFish v3.0 comes up with Jersey version 1.1.4.1. GlassFish v3.0.1 with Jersey version 1.1.5. To upgrade these to 1.9 you will need to replace certain files manually. GlassFish uses Jersey internally in it's REST administration API, and the Update Center client would not allow you to upgrade in order to prevent this functionality. The workaround described in this section is known to work, but it is not currently a tested and supported scenario. Please keep in mind things could break. It is recommended to back up all all impacted files. The actual replace steps follow. Remove the existing Jersey files: Stop all running server instances. Then remove the following files from the GlassFish installation directory:
12.2.2. GlassFish 3.1 GlassFish 3.1 is released. GlassFish 3.1 builds can be downloaded from http://glassfish.java.net/downloads/3.1-final.html If you want to update the Jersey bits in GlassFish with the latest Jersey snapshot version, or if you want to install Jersey documentation and examples, you would need to do the following steps: Remove the existing Jersey files: Stop all running server instances. Then remove the following files from the GlassFish installation directory:
|