-
Bug
-
Resolution: Won't Do
-
Blocker
-
None
-
2.0.2.Final
-
None
Injecting a @Singleton bean into a @SessionScoped bean fails with the following error message:
Exception in thread "main" org.jboss.weld.exceptions.UnserializableDependencyException:
WELD-001413The bean Managed Bean [class SessionBean] with qualifiers [@Any @Default] declares passivating scope but has non-passivation-capable dependency Managed Bean [class SingletonBean] with qualifiers [@Any @Default]
A quick look into the code revealed the following in Managedbean at line 111
this.passivationCapableDependency = isNormalScoped() || (isDependent() && passivationCapableBean);
Meaning that a the singleton beans can never be flagged as passivation capable dependencies because the @Singleton scope is not annotated as normale scoped and, obviously, the beans are not dependent.
But this is against the CDI 1.1 specification 6.6.3 which clearly states that:
The container must guarantee that:
...
all singleton beans are passivation capable dependencies,
...
- relates to
-
CDI-397 Clarify Section 6.6.3 regarding singletons
- Closed