4 Replies Latest reply on Apr 15, 2010 10:17 AM by ssilvert

    5.1.0.GA: PostConstruct is not called for JSF managed beans

    nbelaevski

      Hello,

       

      We are having problems with @PostConstruct being ignored for JSF managed beans. That is the initial thread: http://community.jboss.org/thread/146611?tstart=30 . There are two issues about this in JBoss AS JIRA already, both are closed as "done": https://jira.jboss.org/jira/browse/JBAS-5673 and https://jira.jboss.org/jira/browse/JBAS-6002 . I've investigated the problem using JBoss 5.1.0.GA (the same issue reported reproducible for 6.0.0.M1) either updated with JSF 2.0 libraries or without them and created simple Maven2 test project illustrating the problem (it's attached). The problem has been tracked down to the used implementation of JSF InjectionProvider interface. The following lines in web.xml:

           <context-param>
                <param-name>com.sun.faces.injectionProvider</param-name>
                <param-value>org.jboss.web.jsf.integration.injection.JBossInjectionProvider</param-value>
           </context-param>
      

      make the annotation work fine, but default implementation of injection provider (org.jboss.web.jsf.integration.injection.JBossDelegatingInjectionProvider) doesn't lead to @PostConstruct being processed.

       

      Can please someone take a look at the problem?