The issue exists because starts from 2.26 the Jersey is not backward compatible. For more information please find the information from official Jersey site.
Unfortunately, there was a need to make backwards incompatible changes in 2.26. Concretely jersey-proprietary reactive client API is completely gone and cannot be supported any longer – it conflicts with what was introduced in JAX-RS 2.1 (that’s the price for Jersey being “spec playground..”).
Another bigger change in Jersey code is attempt to make Jersey core independent of any specific injection framework. As you might now, Jersey 2.x is (was!) pretty tightly dependent on HK2, which sometimes causes issues (esp. when running on other injection containers. Jersey now defines it’s own injection facade, which, when implemented properly, replaces all internal Jersey injection.
Don’t be mistaken – Jersey still runs on hk2. But it should be possible to get rid off that dependency when other container provides same functionality. As already mentioned, the motivation is to be able to integrate seamlessly with other frameworks, like cdi, guice, etc. This is still work in progress and there is one consequence: user has to provide Jersey injection implementation.https://eclipse-ee4j.github.io/jersey.github.io/release-notes/2.26.html
To resolve the issue please add the missing dependency to your project. Please find the Maven and Gradle entries below:
<dependency> <groupId>org.glassfish.jersey.inject</groupId> <artifactId>jersey-hk2</artifactId> <version>2.26</version> </dependency>
... compile group: 'org.glassfish.jersey.inject', name: 'jersey-hk2', version: '2.26' ...
Please verify which version you should add to your project. You can check the available version in Central Maven Repository.