We have a REST-based web application that used to run on Tomcat using relatively new versions of Jersey (2.25.1) and Jackson (2.8.10). These libraries were bundled in the WEB-INF/lib folder of the war, and things worked well.
Due to program requirements, we were forced to migrate to glassfish. We're using the "web profile" version of glassfish 4.1.2 and are running into some problems. We were only able to get the webapp working by downgrading Jersey and Jackson to versions that match glassfish 4.1.2 (Jersey 2.21 and Jackson 2.5.1). In addition, we had to add a missing Jackson jar to the glassfish/modules directory, namely jackson-module-jaxb-annotations-2.5.1.jar
Other posts suggested "upgrading" Jackson by replacing the jars in the glassfish/modules directory with the latest versions. HOWEVER, if we do that, the commands to start/stop the domain throw exceptions. For instance, running "startserv.bat" results in the following:
Exception in thread "Thread-1" java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/JsonFactory
at com.sun.enterprise.admin.remote.reader.ProgressStatusDTOJsonProprietaryReader.<clinit>(ProgressStatusDTOJsonProprietaryReader.java:57)
at com.sun.enterprise.admin.remote.reader.ProprietaryReaderFactory.<clinit>(ProprietaryReaderFactory.java:60)
at com.sun.enterprise.admin.cli.AdminMain$2.run(AdminMain.java:272)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.core.JsonFactory
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 4 more
Is there any way to use the versions of Jackson and/or Jersey that we want, or are we forced to use whatever version comes bundled with glassfish? Also, are we forced to "patch" glassfish by copying in the missing Jackson annotations jar?