Closed sdwbvios closed 7 years ago
The problem was related to class resolution in OSGi. When you have a pom compile dependency the KAR plugin will pull the corresponding bundle into the archive and because of the explicit version requirements (2.24) it will override the already existing bundle that provides the same functionality (2.22.2). Now, the problem is that in Jersey it is also required to register the MIME provider in a non-compliant-OSGi way. And that provider was for 2.22.2 and not for 2.24 that the application code referenced to. OSGi classloader correctly had 2 version of the same library loaded in separate classloader which caused Jersey to fail with NoClassDefFoundError (or such).
Switching to 2.22.2 and (also very importantly) provided
dependency scope removed
duplicate library and the Jersey issue has been resolved.
API methods createNewAvatar and updateUserAvatar need use multipart . and I refer to the documentation https://jersey.java.net/documentation/latest/media.html#d0e9266 . when I add the dependency
in pom.xml .It will appear the error '503 Jersey is not ready yet!'. And there is no error log in karaf.log. I am confused about what caused the problem and how to fix it by using this dependency.