2 Replies Latest reply on Feb 21, 2008 9:49 AM by davide ficano

    pageflow and facelet emails problem

    davide ficano Newbie

      I've a pageflow with a start-page as shwon below



         <start-page name="anagraficaDatiGenerali" view-id="/facelets/ins_anag_generale.xhtml">
            <redirect/>
            <transition name="gotoDatiIndirizzi" to="checkDatiGenerali"/>
            <transition name="gotoLuogoNascita" to="selectLuogoNascita"/>
         </start-page>
      



      From action a send an email using renderer.render
                 


      renderer.render("/facelets/email/plain.xhtml");




      But I receive the error shown below




      08:29:55,421 ERROR [SeamPhaseListener] uncaught exception
      java.lang.IllegalStateException: pageflow is not currently at a <page> or <start-page> node (note that pageflows that begin during the RENDER_RESPONSE phase should use <start-page> instead of <start-state>)
              at org.jboss.seam.pageflow.Pageflow.getPage(Pageflow.java:227)
              at org.jboss.seam.faces.FacesManager.prepareBackswitch(FacesManager.java:239)
              at org.jboss.seam.jsf.SeamPhaseListener.afterRenderResponse(SeamPhaseListener.java:487)
              at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:230)
      




      I have no idea how to resolve the problem, may you help me?

        • 1. Re: pageflow and facelet emails problem
          Gavin King Master

          We need much more information.


          What calls this action? What request throws the exception? Where is the rest of the stack trace?


          What happens if you comment out the line that renders the email?

          • 2. Re: pageflow and facelet emails problem
            davide ficano Newbie

            Below you find the stacktrace, page.xml and xxx.jpdl.xml


            The scenario is



            1. I call the url http://.../facelets/insanaggenerale.seam and the page associated appears without errors

            2. I click on commandButton (code is shown below)



            <h:commandButton value="Test email" id="test" action="gotoDatiIndirizzi" type="submit" />




            1. The code associated to gotoDatiIndirizzi is



            public boolean isValid(){
            renderer.render("/facelets/plain.xhtml");
            return true;
            }
            


            The error appears (full stacktrace below)


            08:29:55,421 ERROR [SeamPhaseListener] uncaught exception
            java.lang.IllegalStateException: pageflow is not currently at a <page> or <start-page> node (note that pageflows that begin during the RENDER_RESPONSE phase should use <start-page> instead of <start-state>)
                 at org.jboss.seam.pageflow.Pageflow.getPage(Pageflow.java:227)
                 at org.jboss.seam.faces.FacesManager.prepareBackswitch(FacesManager.java:239)
                 at org.jboss.seam.jsf.SeamPhaseListener.afterRenderResponse(SeamPhaseListener.java:487)
                 at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:230)
                 at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:184)
                 at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
                 at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
                 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                 at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
                 at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
                 at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                 at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                 at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                 at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
                 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
                 at java.lang.Thread.run(Unknown Source)
            




            1. page.xml is




            <?xml version="1.0" encoding="UTF-8"?>
            <pages xmlns="http://jboss.com/products/seam/pages"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.0.xsd"
            
                   no-conversation-view-id="/home.xhtml"
                   login-view-id="/login.xhtml">
            
                <page view-id="*">
                    <navigation>
                        <rule if-outcome="home">
                            <redirect view-id="/home.xhtml"/>
                        </rule>
                    </navigation>
                </page>
            
            
                <page view-id="/facelets/ins_anag_generale.xhtml" login-required="false">
                  <begin-conversation join="true" pageflow="inserimentoAnagraficaFlow"/>
               </page>
            </pages>
            




            1. jpdl file is



            <pageflow-definition 
                  xmlns="http://jboss.com/products/seam/pageflow"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation=
                  "http://jboss.com/products/seam/pageflow http://jboss.com/products/seam/pageflow-2.0.xsd"
                 name="inserimentoAnagraficaFlow">
               
               <start-page name="anagraficaDatiGenerali" view-id="/facelets/ins_anag_generale.xhtml">
                  <redirect/>
                  <transition name="gotoDatiIndirizzi" to="checkDatiGenerali"/>
                  <transition name="gotoLuogoNascita" to="selectLuogoNascita"/>
               </start-page>
               
               <decision name="checkDatiGenerali" expression="#{anagrafeStudentePrenotazione.isDatiUtenteValid}">
                  <transition name="true" to="anagraficaDatiIndirizzi"/>
                  <transition name="false" to="anagraficaDatiGenerali"/>
               </decision>
               
               <decision name="checkDatiIndirizzi" expression="#{anagrafeStudentePrenotazione.checkDatiIndirizzi}">
                  <transition name="true" to="saveAnagrafica"/>
                  <transition name="false" to="anagraficaDatiIndirizzi"/>
               </decision>
               
               <page name="anagraficaDatiIndirizzi" view-id="/facelets/ins_anag_indirizzi.xhtml">
                  <redirect/>
                  <transition name="false" to="anagraficaDatiIndirizzi"/>
               </page>
            
               <process-state name="selectLuogoNascita">
                  <sub-process name="selectLuogoNascita"/>
                  <transition to="anagraficaDatiGenerali"/>
               </process-state>
            
            </pageflow-definition>