5 Replies Latest reply on Oct 5, 2009 8:16 AM by petercr4

    Redirecting concurrent call errors

    petercr4
      I have problem catching and redirecting concurrent call errors.

      If I use http error code as described from documentation (see below), the error gets caught.

      <exception class="org.jboss.seam.ConcurrentRequestTimeoutException" logLevel="trace">
            <http-error error-code="503" />
      </exception>

      However if I try to redirect to error page (like below), this error never gets caught. Any idea why?

      <exception class="org.jboss.seam.ConcurrentRequestTimeoutException" logLevel="trace">
         <end-conversation/>
         <redirect view-id="/error.xhtml">
            <message>The server is too busy to process your request, please try again later</message>
         </redirect>
      </exception>

        • 1. Re: Redirecting concurrent call errors
          sanjaybhatt73

          Peter, did u find solution for this?


          I am also facing the same problem.

          • 2. Re: Redirecting concurrent call errors
            vaughnb.vaughn.butt.datacom.co.nz
            I think this is a bug in Seam. Either in the documentation that says you can do end-conversation and redirect when you can't or with Seam because you should be able to end-conversation and redirect or possibly there is some condition that is undocumented.

            I was able to duplicate Peter's results (expected behaviour with http-error and unexpected exceptions with end-conversation and redirection) with a seam-gen project that had a seam-generated action.

            My system is java 1.6.0_16-b01, JBoss 5.1.0GA.

            With debug turned off (in components.xml I got the error message 'Something bad happened :-( Unexpected error, please try again' which implies the final exception handler was invoked.

            Note that _none_ of the examples included in the Seam distribution have end-conversation and redirect on ConcurrentRequestTimeoutException

            I'm not sure what files to include so I haven't included any. I can include any that are required.

            Partial log:
            17:27:09,077 WARN  [SeamPhaseListener] uncaught exception, passing to exception handler
            org.jboss.seam.ConcurrentRequestTimeoutException: Concurrent call to conversation
                    at org.jboss.seam.core.Manager.restoreAndLockConversation(Manager.java:641)
                    at org.jboss.seam.core.Manager.restoreConversation(Manager.java:603)
                    at org.jboss.seam.jsf.SeamPhaseListener.afterRestoreView(SeamPhaseListener.java:392)
                    ...
                    at java.lang.Thread.run(Thread.java:619)
            17:27:09,309 ERROR [SeamPhaseListener] swallowing exception
            org.jboss.seam.ConcurrentRequestTimeoutException: Concurrent call to conversation
                    at org.jboss.seam.core.Manager.restoreAndLockConversation(Manager.java:641)
                    at org.jboss.seam.core.Manager.restoreConversation(Manager.java:603)
                    at org.jboss.seam.jsf.SeamPhaseListener.afterRestoreView(SeamPhaseListener.java:392)
                    at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:230)
                    at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:196)
                    at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:175)
                    ...
                    at java.lang.Thread.run(Thread.java:619)
            17:27:09,550 WARN  [Component] Cannot create Seam component, scope is not active: org.jboss.seam.international.statusMessages(CONVERSATION)
            17:27:09,570 ERROR [TxPolicy] javax.ejb.EJBTransactionRolledbackException: @In attribute requires non-null value: VaughnFoo.statusMessages
            17:27:09,576 SEVERE [application] javax.ejb.EJBTransactionRolledbackException: @In attribute requires non-null value: VaughnFoo.statusMessages
            javax.faces.el.EvaluationException: javax.ejb.EJBTransactionRolledbackException: @In attribute requires non-null value: VaughnFoo.statusMessages
                    at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
                    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
                    at javax.faces.component.UICommand.broadcast(UICommand.java:387)
                    at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
                    at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
                    at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
                    at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
                    at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
            • 3. Re: Redirecting concurrent call errors
              petercr4

              With recent Richfaces libraries I avoid this problem by using a4j:queue component on the pages where this is necesarry (when I have onkeyup event for example).


              From richfaces documentation:
              "The <a4j:queue/> (defined as global for the form where controls are placed) handles all requests and fires the next one only after the response from the previous returned. "


              This breaks the asynchronous part of AJAX but is good enough for my type of applications.

              • 4. Re: Redirecting concurrent call errors
                vaughnb.vaughn.butt.datacom.co.nz

                I agree with Peter that the problem can be mitigated by using a queue on the client side but, as you say, it serialises all of the server requests removing the asynchronicity of AJAX. OTOH, if I understand the way Seam works, then serialising on the client side won't make a difference anyway because Seam serialises all server requests that are part of a conversation.


                Peter, I take it you never actually got redirect on ConcurrentRequestTimeoutException working.

                • 5. Re: Redirecting concurrent call errors
                  petercr4

                  No, I never got it working with that exception. As I can see from your post that bug is still there.