Using Jersey 2.15.
I have a class like:
public class MyFilter extends ContainerRequestFilter {
@Inject
MyClass test;
// the usual code
}
On deploy, I am getting the following exception:
…
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: org.glassfish.hk2.api.UnsatisfiedDependencyException: There was no object available for injection at SystemInjecteeImpl(requiredType= MyClass,parent= MyFilter,qualifiers={},position=-1,optional=false,self=false,unqualified=null,2094033049)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:168)
Other resource classes accept this Injection (for MyClass) without problems. @EJB injection into ContainerRequestFilters also work. Why not CDI?
M.