Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to upgrade Jersey 2.2 to Glassfish 4?

I've tried to upgrade the Jersey 2.2 to the Glassfish 4 by replacing the following jars at the [gf_home]/glassfish/modules with version 2.2

  1. jersey-bean-validation.jar
  2. jersey-client.jar
  3. jersey-common.jar
  4. jersey-container-grizzly2-http.jar
  5. jersey-container-servlet-core.jar
  6. jersey-container-servlet.jar
  7. jersey-gf-cdi.jar
  8. jersey-gf-ejb.jar
  9. jersey-media-json-jackson.jar
  10. jersey-media-json-jettison.jar
  11. jersey-media-json-processing.jar
  12. jersey-media-moxy.jar
  13. jersey-media-multipart.jar
  14. jersey-media-sse.jar
  15. jersey-mvc-connector.jar
  16. jersey-mvc-jsp.jar
  17. jersey-mvc.jar
  18. jersey-server.jar

After clearing the [gf_home]/glassfish/glassfish/domains/domain1/osgi-cache and try to start the glassfish but there is no luck. Could you please help to advise further?

like image 278
Charlee Chitsuk Avatar asked Aug 23 '13 02:08

Charlee Chitsuk


1 Answers

the approach you did is correct. The problem is that Glassfish 4.0 might not work with newest Jersey version as there might be incompatibilities. Jersey is used internally in Glassfish and when there is a problem with incompatible Jersey versions, Glassfish might not even start (like in your case).

You can try using one of the Glassfish night builds which have already Jersey 2.2 integrated.

http://dlc.sun.com.edgesuite.net/glassfish/4.0.1/nightly/

The link is accessible from http://glassfish.org (Download->Work in progress). Night build versions might be unstable.

You can try for example build: http://dlc.sun.com.edgesuite.net/glassfish/4.0.1/nightly/glassfish-4.0.1-b02-08_22_2013.zip

Mira

EDIT 1

In the following article you can find a script that does the update of Jersey 2 in GlassFish 4.0.1 for you:

  • Updating Jersey 2 in GlassFish 4
like image 72
Miroslav Fuksa Avatar answered Sep 28 '22 20:09

Miroslav Fuksa