-
1. Re: PostConstruct and PreDestroy of Bean
asiandub Aug 27, 2010 8:47 AM (in response to nimo22)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?
cheers,
jan
-
2. Re: PostConstruct and PreDestroy of Bean
asiandub Aug 27, 2010 8:51 AM (in response to nimo22)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.... -
3. Re: PostConstruct and PreDestroy of Bean
pmuir Sep 1, 2010 8:57 AM (in response to nimo22)Sounds very weird, if you can reproduce in a simple cdi app (no seam etc), please file an issue :-)
-
4. Re: PostConstruct and PreDestroy of Bean
nimo22 Sep 1, 2010 9:18 AM (in response to nimo22)Hello,
the reason is found in:
http://seamframework.org/Community/BeansInjectReturnsNull
I had this
import javax.faces.bean.SessionScoped;
instead of this
import javax.enterprise.context.SessionScoped;
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)!