0 Replies Latest reply on Aug 13, 2009 8:35 PM by willie slepecki

    pageflow has not yet started in middle of pageflow when exception thrown

    willie slepecki Newbie

      my app has to work in an environment where the seam servers connection to its transaction processing server is spotty at best.


      here is the problem im having, if a connection exception is thrown starting the conversation, the exception handling system picks it up correctly and routs them to the error page just fine.  BUT, as you run thru the pageflow, there are several calls to the backend server.  if an exception is thrown on one of those, nothing happens.  so i put this in the pageflow




      <transition name="continue" to="cbd_pri_app2" >
                     <action expression="#{menuBackingEJB.checkZipLoaded('pri1')}" />
                </transition>



      now that method makes sure that the zip code transaction was run and it successfully returned data (initially fired by a valuechangelistener) now, if that method in the transition throws an exception, the app gets locked in a redirect loop and i eventually get a redirect loop error at the browser.  my log file looks like this


      Caused by: org.jbpm.jpdl.el.ELException: Error evaluating ${menuBackingEJB.checkZipLoaded('pri1')}; possible causes are logged at debug level
           at org.jboss.seam.bpm.SeamExpressionEvaluator$1.evaluate(SeamExpressionEvaluator.java:142)
           at org.jboss.seam.bpm.SeamExpressionEvaluator.evaluate(SeamExpressionEvaluator.java:45)
           at org.jbpm.jpdl.el.impl.JbpmExpressionEvaluator.evaluate(JbpmExpressionEvaluator.java:39)
           ... 66 more
      2009-08-13 14:22:24,085 DEBUG [org.jboss.seam.contexts.FacesLifecycle] After render response, destroying contexts
      2009-08-13 14:22:24,085 DEBUG [org.jboss.seam.contexts.Contexts] flushing server-side conversation context
      2009-08-13 14:22:24,087 DEBUG [org.jboss.seam.contexts.Contexts] flushing session context
      2009-08-13 14:22:24,087 DEBUG [org.jboss.seam.contexts.Contexts] destroying event context
      2009-08-13 14:22:24,087 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.jboss.seam.core.manager
      2009-08-13 14:22:24,087 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.jboss.seam.core.events
      2009-08-13 14:22:24,087 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.jboss.seam.core.conversationPropagation
      2009-08-13 14:22:24,087 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.jboss.seam.transaction.transaction
      2009-08-13 14:22:24,088 DEBUG [org.jboss.seam.contexts.FacesLifecycle] <<< End JSF request for /_master/eca/cbd/PrimaryApp.seam
      2009-08-13 14:22:24,088 DEBUG [org.jboss.seam.web.ExceptionFilter] done running exception handlers
      2009-08-13 14:22:24,088 DEBUG [org.ajax4jsf.webapp.BaseFilter] Finished request processing total time 115ms for uri: /_master/eca/cbd/PrimaryApp.seam
      2009-08-13 14:22:25,087 DEBUG [org.ajax4jsf.webapp.BaseFilter] Filter start request processing at 8/13/09 2:22 PM  for uri: /_master/error.seam
      2009-08-13 14:22:25,087 DEBUG [org.ajax4jsf.webapp.BaseFilter] Filter request output to XML
      2009-08-13 14:22:25,087 DEBUG [org.ajax4jsf.webapp.BaseXMLFilter] XML filter service start processing request
      2009-08-13 14:22:25,087 DEBUG [javax.enterprise.resource.webcontainer.jsf.lifecycle] execute(com.sun.faces.context.FacesContextImpl@1720ed6)
      2009-08-13 14:22:25,087 DEBUG [org.jboss.seam.contexts.FacesLifecycle] >>> Begin JSF request for /_master/error.seam
      2009-08-13 14:22:25,088 DEBUG [org.jboss.seam.jsf.SeamPhaseListener] beginning transaction prior to phase: RESTORE_VIEW 1
      2009-08-13 14:22:25,088 DEBUG [org.jboss.seam.transaction.UTTransaction] beginning JTA transaction
      2009-08-13 14:22:25,088 DEBUG [org.ajax4jsf.event.AjaxPhaseListener] Process before phase RESTORE_VIEW 1
      2009-08-13 14:22:25,089 DEBUG [javax.enterprise.resource.webcontainer.jsf.lifecycle] Entering RestoreViewPhase
      2009-08-13 14:22:25,089 DEBUG [javax.enterprise.resource.webcontainer.jsf.lifecycle] New request: creating a view for /error.seam
      2009-08-13 14:22:25,089 DEBUG [javax.enterprise.resource.webcontainer.jsf.application] Created component with component type of 'javax.faces.ViewRoot'
      2009-08-13 14:22:25,090 DEBUG [javax.enterprise.resource.webcontainer.jsf.application] servletPath /error.seam
      2009-08-13 14:22:25,090 DEBUG [javax.enterprise.resource.webcontainer.jsf.application] pathInfo null
      2009-08-13 14:22:25,090 DEBUG [javax.enterprise.resource.webcontainer.jsf.application] URL pattern of the FacesServlet executing the current request .seam
      2009-08-13 14:22:25,090 DEBUG [javax.enterprise.resource.webcontainer.jsf.application] viewId after appending the context suffix /error.xhtml
      2009-08-13 14:22:25,090 DEBUG [javax.enterprise.resource.webcontainer.jsf.application] Created new view for /error.xhtml
      2009-08-13 14:22:25,090 DEBUG [javax.enterprise.resource.webcontainer.jsf.application] Locale for this view as determined by calculateLocale en
      2009-08-13 14:22:25,090 DEBUG [javax.enterprise.resource.webcontainer.jsf.application] RenderKitId for this view as determined by calculateRenderKitId HTML_BASIC
      2009-08-13 14:22:25,090 DEBUG [javax.enterprise.resource.webcontainer.jsf.lifecycle] Exiting RestoreViewPhase
      2009-08-13 14:22:25,090 DEBUG [org.ajax4jsf.event.AjaxPhaseListener] Process after phase RESTORE_VIEW 1
      2009-08-13 14:22:25,090 DEBUG [org.jboss.seam.core.Manager] Restoring conversation with id: 2
      2009-08-13 14:22:25,092 DEBUG [org.jboss.seam.jsf.SeamPhaseListener] committing transaction after phase: RESTORE_VIEW 1
      2009-08-13 14:22:25,093 DEBUG [org.jboss.seam.transaction.UTTransaction] committing JTA transaction
      2009-08-13 14:22:25,093 DEBUG [javax.enterprise.resource.webcontainer.jsf.timing]  [TIMING] - [6ms] : Execution time for phase (including any PhaseListeners) -> RESTORE_VIEW 1
      2009-08-13 14:22:25,093 DEBUG [javax.enterprise.resource.webcontainer.jsf.lifecycle] render(com.sun.faces.context.FacesContextImpl@1720ed6)
      2009-08-13 14:22:25,093 DEBUG [org.jboss.seam.jsf.SeamPhaseListener] beginning transaction prior to phase: RENDER_RESPONSE 6
      2009-08-13 14:22:25,093 DEBUG [org.jboss.seam.transaction.UTTransaction] beginning JTA transaction
      2009-08-13 14:22:25,094 DEBUG [javax.enterprise.resource.webcontainer.jsf.context] Adding Message[sourceId=<<NONE>>,summary=Transaction failed)
      2009-08-13 14:22:25,094 DEBUG [javax.enterprise.resource.webcontainer.jsf.context] Adding Message[sourceId=<<NONE>>,summary=Unexpected error, please try again)
      2009-08-13 14:22:25,094 DEBUG [org.jboss.seam.faces.Navigator] redirecting to: /error.xhtml
      2009-08-13 14:22:25,094 DEBUG [javax.enterprise.resource.webcontainer.jsf.application] URL pattern of the FacesServlet executing the current request .seam
      2009-08-13 14:22:25,094 DEBUG [org.jboss.seam.faces.FacesManager] redirecting to: /_master/error.seam?cid=2
      2009-08-13 14:22:25,094 DEBUG [org.jboss.seam.web.RewritingResponse] encodeURL /_master/error.seam?cid=2 -> /_master/error.seam?cid=2
      2009-08-13 14:22:25,095 ERROR [org.jboss.seam.exception.Exceptions] handled and logged exception
      java.lang.IllegalStateException: pageflow has not yet started
           at org.jboss.seam.pageflow.Pageflow.getNode(Pageflow.java:177)
           at org.jboss.seam.faces.FacesPage.storePageflow(FacesPage.java:74)
           at org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:491)
           at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:148)
           at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:118)
           at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:214)
           at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:96)
           at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
           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.web.RewriteFilter.doFilter(RewriteFilter.java:63)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
           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:45)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
           at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
           at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)




      obviously the pageflow is started because im in the middle of it at the time this is fired.  why does this work when im starting the conversation but it doesn't work when im in the middle of it?