]
Marek Novotny updated JBSEAM-3848:
----------------------------------
Original Estimate: 2 days
Remaining Estimate: 2 days
Forum Reference:
Seam fails to create and inject components when multiple
ajax-requests are fired from a commandLink or commandButton, using ajax4jsf.
-------------------------------------------------------------------------------------------------------------------------------------
Key: JBSEAM-3848
URL:
https://issues.jboss.org/browse/JBSEAM-3848
Project: Seam 2
Issue Type: Bug
Components: Core
Affects Versions: 2.0.0.BETA1
Environment: windows vista / rhel4
sun jdk5, jdk6 latest versions
jboss as 4.2.2 and 4.2.3
firefox2 and 3, ie 6 and 7.
Reporter: etirk etirk
Assignee: Marek Novotny
Labels: a4j, ajax, core, jsf, seam
Fix For: 2.3.0.BETA1
Original Estimate: 2 days
Remaining Estimate: 2 days
Seam fails to create and inject components when multiple ajax-requests are fired from a
commandLink or commandButton, using ajax4jsf.
Replication found using seam-booking in examples, trunk as of 081216.
Rewrite the find-method in the HotelSearchAction-class, in the seam booking example
application. It should look like this.
public void find() {
page = 0;
queryHotels();
try {
Thread.sleep(1000 * 5);
} catch (InterruptedException ignore) {
}
}
Now, start the application, register a user and enter main.html. Click multiple times on
the search hotel button. Depending upon how fast your computer is, you might need to do
more than a double-click. Sometimes you may need to klick fast up to 5-8 times. But it
will occur.
You will end up with an exception that says:
Caused by javax.servlet.ServletException with message: javax.el.ELException: /main.xhtml
@74,130 rendered=#{hotelSearch.nextPageAvailable}: Error reading nextPageAvailable on type
org.javassist.tmp.java.lang.Object_$$_javassist_4
Which in turn comes from a synchronization problem.
Caused by org.jboss.seam.core.LockTimeoutException with message: could not acquire lock
on @Synchronized component: hotelSearch
This is in a way funny, since the hotelSearch-component is not annotated with
synchronized. Anyway, our application does not throw an exception like this, but we to
have tried synchronizing our involved components, with no luck. Our exception is mostly
this
Caused by javax.servlet.ServletException with message: javax.el.ELException:
/layout/template.xhtml @18,59 rendered=#{authenticator.inSpecialMode}: Error reading
inSpecialMode on type se.session.Authenticator_$$_javassist_4
Which in turn comes from the failed injections
Caused by org.jboss.seam.RequiredException with message: @In attribute requires non-null
value: authenticator.entityManager
This problem occurs all over the application, always when an ajax request is
double-clicked and seam tries to recreate seam components and runs out of time. In 99% of
the case it is the first read property of our authenticator-component that fails, and most
often it is that seam cannot create a entityManager to inject, and the system fails due to
that the annotation is set to only inject, without create. Removing the entityManager from
the component will only result in that seam cannot inject another component instead, until
you have no injections left in authenticator, and it still fails!
Similar behaviour has been noticed using non-ajax calls, using standard
h:commandButton/Link. This is however much more rare.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: