Issue Type: Bug Bug
Affects Versions: 2.0.2.Final
Assignee: Jozef Hartinger
Components: Scopes & Contexts
Created: 23/Aug/13 9:52 AM
Description:

Injecting a @Singleton bean into a @SessionScoped bean fails with the following error message:

Exception in thread "main" org.jboss.weld.exceptions.UnserializableDependencyException: WELD-001413 The 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,
...

Environment: weld-se
Project: Weld
Priority: Blocker Blocker
Reporter: Ramin Baradari
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira