5 Replies Latest reply on May 28, 2009 1:40 PM by John Gilbert

    ConcurrentRequestTimeoutException

    John Gilbert Apprentice

      Has anyone seen this? It only happens on the first 2 times I try to create a JSFSession and then the rest go through fine.

      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.jsfunit.seam.SeamRequestListener.restoreConversation(SeamRequestListener.java:73)
       at org.jboss.jsfunit.seam.SeamRequestListener.afterRequest(SeamRequestListener.java:62)
       at org.jboss.jsfunit.framework.JSFUnitWebConnection.notifyListenersAfter(JSFUnitWebConnection.java:103)
       at org.jboss.jsfunit.framework.JSFUnitWebConnection.getResponse(JSFUnitWebConnection.java:84)
       at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1487)
       at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1445)
       at com.gargoylesoftware.htmlunit.html.HtmlPage.loadJavaScriptFromUrl(HtmlPage.java:1063)
       at com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:1002)
       at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:358)
       at com.gargoylesoftware.htmlunit.html.HtmlScript$1.execute(HtmlScript.java:222)
       at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:238)
       at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:569)
       at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
       at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:523)
       at org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:210)
       at org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:329)
       at org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:993)
       at org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:896)
       at org.cyberneko.html.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:2893)
       at org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:1954)
       at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:893)
       at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:495)
       at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:448)
       at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
       at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:771)
       at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:252)
       at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:127)
       at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:101)
       at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:439)
       at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:327)
       at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:384)
       at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:369)
       at org.jboss.jsfunit.framework.SimpleInitialRequestStrategy.doInitialRequest(SimpleInitialRequestStrategy.java:48)
       at org.jboss.jsfunit.framework.FormAuthenticationStrategy.doInitialRequest(FormAuthenticationStrategy.java:105)
       at org.jboss.jsfunit.framework.WebClientSpec.doInitialRequest(WebClientSpec.java:244)
       at org.jboss.jsfunit.jsfsession.JSFSession.<init>(JSFSession.java:80)
       at net.taylor.results.jsfunit.BaseFaceletRenderTest.init(BaseFaceletRenderTest.java:113)
       at net.taylor.results.jsfunit.BaseFaceletRenderTest.doTest(BaseFaceletRenderTest.java:66)
       at catalog.FaceletRenderTest.testBundle(FaceletRenderTest.java:63)
      
      


        • 1. Re: ConcurrentRequestTimeoutException
          Stan Silvert Master

          Hi,

          Have you tried setting a higher value for concurrent-request-timeout?
          http://sfwk.org/Community/ConversationEndedTimedOutOrWasProcessingAnotherRequest

          Stan

          • 2. Re: ConcurrentRequestTimeoutException
            John Gilbert Apprentice

            Thanks.

            I do have the conversation time out cranked way up, but there aren't concurrent calls happening. There is some wacky state problem going on.

            When SeamRequestListener calls Manager.restoreConversation() the Manager thinks that the ConversationEntry is not null and not locked and thus throws.

            it has been a challange to debug, because it only happens the first time and I have to bounce the server to get it to happen again.

            Very strange...

            It might be related to this error I get from the org.jboss.seam.transaction.EjbSynchronizations component. Again it only happens the first time and only with my jsfunit tests.

            Caused by: javax.ejb.NoSuchEJBException: Could not find stateful bean: 5c4o315-tdyu9p-fv8nqgdd-1-fv8nstbz-kk
             at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:390)
             at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:375)
             at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:61)
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
             at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
             at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
             at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
             at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
             at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:206)
             at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:119)
             at $Proxy200.afterTransactionBegin(Unknown Source)
            


            • 3. Re: ConcurrentRequestTimeoutException
              John Gilbert Apprentice

              Here is an update.

              I overrode WebClientSpec to remove the call to doSeamSetup() and the ConcurrentRequestTimeoutException went away.

              The NoSuchEJBException is still happening.

              So, this is just a clue, not a solution.

              Still digging...

              • 4. Re: ConcurrentRequestTimeoutException
                John Gilbert Apprentice

                OK, I have worked through/around this. I think the trouble starts with FormAuthenticationStrategy.

                I stopped using the InitialRequestStrategy and just make an inital explicit call to my login.seam facelet and everything works great.

                My theory is that, when using InitialRequestStrategy, somewhere in the redirect for login the external context request map gets stale and holds onto the old proxy to the EjbSynchronizations that was previously destroyed. This causes the NoSuchEJBException when accessed.

                This exception then messes up the conversation state which causes the ConcurrentRequestTimeoutException when SeamRequestListener does its thing.

                It is still odd that this only happens on the first session. So, there is some sort of special case that is not obvious.

                It would still be preferrable to use the InitialRequestStrategy if we can figure this thing out.

                Any thoughts?



                • 5. Re: ConcurrentRequestTimeoutException
                  John Gilbert Apprentice

                  More info:

                  It looks like the NoSuchEJBException is still happening when the webClient retreives the richfaces javascripts referenced in the first page.

                  However, when not within the scope of an InitialRequestStrategy, this seems to not cause any damage.