I have a Quarkus app that uses cdi
and resteasy
. I have a bean that is annotated as SessionScoped
import javax.enterprise.context.SessionScoped;
@SessionScoped
public class SessionScopedBean implements Serializable {}
When I inject this bean into my web resource I get javax.enterprise.inject.UnsatisfiedResolutionException
:
@Path("/dep")
public class DependencyResource {
private final SessionScopedBean ses;
public DependencyResource(SessionScopedBean ses) {
this.ses = ses;
}
}
Stack trace:
Caused by: javax.enterprise.inject.UnsatisfiedResolutionException:
Unsatisfied dependency for type SessionScopedBean and qualifiers [@Default]
- java member: DependencyResource#<init>()
- declared on CLASS bean [types=[DependencyResource], qualifiers=[@Default, @Any], target=DependencyResource]
at io.quarkus.arc.processor.Beans.resolveInjectionPoint(Beans.java:472)
at io.quarkus.arc.processor.BeanInfo.init(BeanInfo.java:404)
at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:212)
If I change it to ApplicationScoped
or RequestScoped
it works without any other changes.
Do SessionScoped
beans work with Quarkus 1.0.0.CR1?
import javax.enterprise.context.SessionScoped;
– Sean