7 Replies Latest reply on Jan 9, 2008 7:17 PM by Pete Muir

    occasional could not acquire lock on @Synchronized component

    mgrouch Expert

      I'm getting occasional exceptions with seam

      Caused by java.lang.IllegalStateException with message: "could not acquire lock on @Synchronized component

      Caused by javax.servlet.ServletException with message: "javax.el.ELException: /WEB-INF/tags/commandLinkWithCaret.xhtml @18,65 rendered="#{rendered and active}": /WEB-INF/tags/lookupProduct.xhtml @61,74 active="#{!empty productLookup.foundProduct}": Error reading 'foundProduct' on type net.sf.jbprize.portal.action.ProductLookupAction_$$_javassist_38"

        • 1. Re: occasional could not acquire lock on @Synchronized compo
          mgrouch Expert

          And the stack trace


          Caused by: java.lang.IllegalStateException: could not acquire lock on @Synchronized component: productLookup
          at org.jboss.seam.interceptors.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:40)
          at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
          at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
          at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:151)
          at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:87)
          at net.sf.jbprize.portal.action.ProductLookupAction_$$_javassist_38.getProductIdType(ProductLookupAction_$$_javassist_38.java


          • 2. Re: occasional could not acquire lock on @Synchronized compo
            Gavin King Master

            Presumably some kind of deadlock between two threads that both try to access the same objects.

            • 3. Re: occasional could not acquire lock on @Synchronized compo
              Jeremy Barth Newbie

              I'm also getting this exception. Are you using ajax4jsf components as well? I have a feeling it has something to do with multiple ajax requests trying to use the seam components at the same time.

              • 4. Re: occasional could not acquire lock on @Synchronized compo
                Arbi Sookazian Master

                I'm getting this as well (intermittently and can't reproduce on demand). I thought it had to do with adding a debug stop in a @WebRemote annotated method but not sure exactly what's causing this behavior. I am using multiple a4j and rich components in a single xhtml.

                stack trace:

                10:37:37,099 ERROR [ExceptionFilter] handling uncaught exception
                javax.servlet.ServletException: could not acquire lock on @Synchronized component: noteAction
                 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:118)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                 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)
                Caused by: java.lang.IllegalStateException: could not acquire lock on @Synchronized component: noteAction
                 at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:41)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                 at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
                 at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
                 at org.javassist.tmp.java.lang.Object_$$_javassist_2.toString(Object_$$_javassist_2.java)
                 at com.sun.facelets.util.DevTools.writeVariables(DevTools.java:168)
                 at com.sun.facelets.util.DevTools.writeVariables(DevTools.java:147)
                 at com.sun.facelets.util.DevTools.debugHtml(DevTools.java:109)
                 at com.sun.facelets.FaceletViewHandler.handleRenderException(FaceletViewHandler.java:692)
                 at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:660)
                 at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
                 at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
                 at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
                 at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                 at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
                 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
                 ... 40 more
                10:37:37,161 ERROR [ExceptionFilter] exception root cause
                java.lang.IllegalStateException: could not acquire lock on @Synchronized component: noteAction
                 at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:41)
                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                 at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
                 at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
                 at org.javassist.tmp.java.lang.Object_$$_javassist_2.toString(Object_$$_javassist_2.java)
                 at com.sun.facelets.util.DevTools.writeVariables(DevTools.java:168)
                 at com.sun.facelets.util.DevTools.writeVariables(DevTools.java:147)
                 at com.sun.facelets.util.DevTools.debugHtml(DevTools.java:109)
                 at com.sun.facelets.FaceletViewHandler.handleRenderException(FaceletViewHandler.java:692)
                 at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:660)
                 at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
                 at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
                 at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
                 at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                 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 jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:118)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                 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)


                • 5. Re: occasional could not acquire lock on @Synchronized compo
                  Pete Muir Master

                  Well, you'll need increase the timeout for trying to obtain the lock. By default a second.

                  • 6. Re: occasional could not acquire lock on @Synchronized compo
                    Tobias Hill Newbie

                    Hmm, I get this quite instantly when I load-test the seam-components. Could you just clarify what you mean by "increasing the timeout"? how do I do this? I suspect that this is not the "concurrent-request-timeout" - the mentioning about timeouts in the ref is mainly about conversations, so I am a bit lost here.

                    • 7. Re: occasional could not acquire lock on @Synchronized compo
                      Pete Muir Master

                      @Synchronized(timeout=100000000000)