Ich habe einen JAXRS Anbieter:JavaEE CDI und JAXRS in @Provider Injektion gibt UnsatisfiedDependencyException
@Provider
@Priority(Priorities.AUTHENTICATION)
public class AuthFilter implements ContainerRequestFilter {
@Inject
private AuthSecurityContext authSecurityContext;
// ...
}
Und meine Security Umsetzung:
@RequestScoped
public class AuthSecurityContext implements SecurityContext {
// ...
}
Ich bin mit Glasfischen wie mein Container aber es wirft die folgende Ausnahme:
2017-06-26T01:04:49.139+0100|Warning: The following warnings have been detected: WARNING: Unknown HK2 failure detected:
MultiException stack 1 of 1
org.glassfish.hk2.api.UnsatisfiedDependencyException: There was no object available for injection at SystemInjecteeImpl(requiredType=AuthSecurityContext,parent=AuthFilter,qualifiers={},position=-1,optional=false,self=false,unqualified=null,2049394753)
Meine anderen Bohnen werden entdeckt und injiziert t dieser in der @Provider
funktioniert nicht, was fehlt mir?
Welchen Server benutzen Sie? – Rouliboy
Stellen Sie sicher, dass Sie 'javax.enterprise.context.RequestScoped' und nicht' javax.faces.bean.RequestScoped' verwenden. – maress
@Rouliboy Ich verwende Glassfish 4.1 als Container. – Neilos