I'm observing the same behavior with a view-scoped bean (from seam-faces).
I vaguely remember that I've heard something about a related JBoss-AS-Bug in M4 (which is my setup), but basically I'd like to be sure about the reason.
so: bug or intention?
oops: just to make sure - I'm referring to the @PreDestroy part of Nimo's posting.
Concerning the getter / setter part: ASFAIK, those are called multiple times because of the inherent JSF-lifecycle. This means that there is nothing
to be resolved, it's just in the inherent nature of the technology....
Sounds very weird, if you can reproduce in a simple cdi app (no seam etc), please file an issue :-)
the reason is found in:
I had this
instead of this
So I imported the jsf-scopes instead of the cdi-scopes.
Would be nice, if CDI would warn or returns an deployement-error,
if it detects a scope of a jsf-version instead of a scope of the cdi-version.
One should not be allowed to use the scope of a jsf-version in a CDI-Environment
- so this should return a deployement error (or at least a warning)!