1 Reply Latest reply on Sep 12, 2007 4:15 PM by Jason Lee

    IllegalStateException: could not acquire lock

    Jason Lee Newbie

      In another thread, which I'll update shortly, I've had trouble getting Seam (with the JSF 1.2 RI) running under oc4j 10.1.3. While I now have it reliably deploying and (mostly) running, I'm running into an odd problem. I have a page that displays a RichFaces tree from which the user selects an Item. Once the user clicks an Item, an Ajax request is made (via a4j) to update a section of the page with the Item information, allowing the user to edit it. This all works under GlassFish. Under oc4j, however, when I click on an Item, I get this error on the server:

      Caused by: java.lang.IllegalStateException: could not acquire lock on @Synchronized component: iota
       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.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:155)
       at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:91)
       at gov.faa.ato.iota.web.IotaManagedBean_$$_javassist_0.getOrganization(IotaManagedBean_$$_javassist_0.java)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at javax.el.BeanELResolver.getValue(BeanELResolver.java:292)
       at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
       at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:73)
       at org.jboss.el.parser.AstPropertySuffix.getValue(AstPropertySuffix.java:53)
       at org.jboss.el.parser.AstValue.getValue(AstValue.java:67)
       at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
       at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
       ... 36 more

      For the record, the Seam code that causes that exception is

      if ( lock.tryLock( getComponent().getTimeout(), TimeUnit.MILLISECONDS ) )

      Any thoughts on what's going on?

        • 1. Re: IllegalStateException: could not acquire lock
          Jason Lee Newbie

          Well, some progress to report. I built a Seam "nightly" and redeployed my app, and things seem to be better. If I click like a "normal" user, things are fine, but if I go nuts and click the link a bunch of times, I get the locking error. My only guess is that there's a timing issue between my onslaught of requests and the lock releases, but that's a semi-educated and somewhat obvious guess. The upshot is that it's working well enough for demoing/testing, though I'd still like to get a real fix for it.

          Any pointers are appreciated. I have the Seam source checked out, so I can go diving through that, and, of course, if the issue lies with JSF RI, I can fix that (hopefully) in short order. Thanks. :)