1 Reply Latest reply on Jul 23, 2013 3:50 PM by ssilvert

    @postcontruct not called with MyFaces on EAP 6.1

    weimeilin

      @postcontruct in @managebean with MyFaces 2.1.5 (also tried 2.2.0) was not executed.

      I have wrote a sample application, attached in the attachment.

       

      What I did was writing a simple hellobean, and system.out  a "Do Post Construct!" String.

       

      ======================================

      @PostConstruct

                public void init(){

                          System.out.println("Do Post Construct! ");

       

                }

      ======================================

       

      The Program with @postcontruct works in EAP 6.0.0 and EAP 6.0.1 but not EAP 6.1

       

      Tried Installation Method:

      ================================

      Scenario One

      Tried install Myfaces into moulds with this method.

      (https://community.jboss.org/wiki/DesignOfAS7Multi-JSFFeature)

       

      Scenario Two (I don't think it make much difference, but I tried AnyWAY)

      Tried disable JSF subsystem and put myfaces jars in WAR/WEB-INF/lib

       

       

      From the log, it shows the TomcatAnnotationLifecycleProvider did create the bean, but didn't execute the postcontruct..

       

       

      [0m[0m12:59:24,106 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:10590

      [0m[0m12:59:24,106 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss EAP 6.1.0.GA (AS 7.2.0.Final-redhat-8) started in 6972ms - Started 832 of 902 services (62 services are passive or on-demand)

      [0m[0m12:59:33,835 INFO  [org.apache.myfaces.util.ExternalSpecifications] (http-localhost/127.0.0.1:8680-1) MyFaces Unified EL support enabled

      [0m[0m12:59:33,873 INFO  [org.apache.myfaces.config.annotation.TomcatAnnotationLifecycleProvider] (http-localhost/127.0.0.1:8680-1) Creating instance of com.redhat.bean.HelloBean

       

      Does anyone ever come arcoss this problem? Is there a way to workaround it.. ?

        • 1. Re: @postcontruct not called with MyFaces on EAP 6.1
          ssilvert

          Multi-JSF is "not quite finished" in EAP 6.1.  I'd rather see you use it though because it is quite solid for WildFly/EAP.next.

           

          I don't have time to go back and test @Postconstruct on MyFaces and EAP 6.1 with Multi-JSF.  However, I do have a test app that uses WAR_BUNDLES_JSF_IMPL and @PostConstruct.  I know that it works.  I'm attaching the maven project for you.

           

          Stan