Jersey Injection Facade

In version 2.26 Jersey started to make their codebase independent of any injection framework. This means that the user has to provide the injection framework, which should be used. The h2k injection framework is completely supported, other frameworks as CDI or guice will follow.

Therefore it could be that you run into the following issue if you try to run your application:

javax.servlet.ServletException: Servlet.init() for servlet Jersey REST Service threw exception org.apache.catalina.authenticator.AuthenticatorBase.invoke( org.apache.catalina.valves.ErrorReportValve.invoke( 

java.lang.IllegalStateException: InjectionManagerFactory not found. org.glassfish.jersey.internal.inject.Injections.lookupInjectionManagerFactory( org.glassfish.jersey.internal.inject.Injections.createInjectionManager( org.glassfish.jersey.server.ApplicationHandler.( org.glassfish.jersey.servlet.WebComponent.( 

To solve that issue you can add the injection framework by using the following snippet in Gradle:

    compile 'org.glassfish.jersey.containers:jersey-container-servlet:2.28'
    // Starting 2.26 Jersey defines it's own injection facade and 
    // we need to provide an implementation for injectionManagerFactory
    compile 'org.glassfish.jersey.inject:jersey-hk2:2.28'

Take a look into the Release Notes to get more detailed information.


Leave a comment

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.