[SOLVED] Jersey Stopped Working With InjectionManagerFactory Not Found: Cool, Short And Quick 1 Solution!

[SOLVED] Jersey stopped working with InjectionManagerFactory not found: Cool, short and quick 1 solution!
Share this post and Earn Free Points!

Problem of injectionmanagerfactory not found

The issue exists because starts from 2.26 the Jersey is not backward compatible [ injectionmanagerfactory not found ].

Introduction

Jersey

Jersey is a Java-based framework for building RESTful web services. InjectionManagerFactory is a class in the Jersey framework that provides a way to create and manage the lifecycle of injectable objects, such as resources, providers, and services.

InjectionManagerFactory

The InjectionManagerFactory class is part of the javax.ws.rs.core package, which is the core package for the Java" API for RESTful Web Services (JAX-RS). It is used to create an instance of the InjectionManager, which is responsible for managing the injectable objects in a Jersey application.

The InjectionManagerFactory class provides a static method called createInjectionManager() that can be used to create a new instance of the InjectionManager. The InjectionManager can then be used to register" injectable objects and to perform dependency injection on those objects.

Missing Backward Compatibility

Backward compatibility refers to the ability of a software or system to continue to function properly when it is used in an environment or with components that are older or different than the ones it was designed for. When backward compatibility is missing, it means that the software or system is not able to work properly in these older or different environments or with these older or different components.

There are several reasons why backward compatibility might be missing in a software or system. One common reason is that the software or system has been updated or changed in a way that is not compatible with the older versions or components. This can happen when new features or capabilities are added that rely on newer technologies or protocols that are not supported by the older versions or components.

Another reason why backward compatibility might be missing is that the software or system was not designed with backward compatibility in mind. In this case, the software or system may rely on specific features or technologies that are not available in the older versions or components, or it may have a different architecture or design that is not compatible with the older versions or components.

Lack of backward compatibility can be a problem for users and organizations that rely on the software or system, as it can limit their ability to use the software or system with their existing systems and infrastructure. It can also be a problem for software developers and vendors, as it can lead to decreased adoption or usage of the software or system. To avoid these problems, it is important for software developers and vendors to consider backward compatibility when designing and updating their products.

Jersey Is Not Backward Compatible

As I mentioned at the beginning the issue exists because starts from 2.26 the Jersey is not backward compatible. 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

[SOLVED] Jersey stopped working with InjectionManagerFactory not found: Cool, short and quick 1 solution!
java.lang.illegalstateexception: injectionmanagerfactory not found.
java".lang.illegalstateexception: injectionmanagerfactory not found.

Solution

To resolve the issue please add the missing dependency to your project. Please find the Maven" and Gradle" entries below:

Maven

<dependency>
    <groupId>org.glassfish.jersey.inject</groupId>
    <artifactId>jersey-hk2</artifactId>
    <version>2.26</version>
</dependency>
[SOLVED] Jersey stopped working with InjectionManagerFactory not found: Cool, short and quick 1 solution!

Gradle

...
compile group: 'org.glassfish.jersey.inject', name: 'jersey-hk2', version: '2.26'
...

Select version

Please verify which version you should add to your project. You can check the available version in Central Maven Repository. Now you will not get error: injectionmanagerfactory not found. Enjoy!

Summary

I hope that this post helped you to understand problem and solve it!

Could You Please Share This Post? 
I appreciate It And Thank YOU! :)
Have A Nice Day!

How useful was this post?

Click on a star to rate it!

Average rating 4.8 / 5. Vote count: 1063

No votes so far! Be the first to rate this post.

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?