FINALLY, the ajax-bug is replicated in seam-booking
etirk Dec 16, 2008 2:37 PMI now post a followup to the bug that has been around in our system for ages, since day one really.
It arises as a
cannot read xxxx on javassist yyyyyyy
every time a ajax request is triggered multiple times.
It seems that it is some sort of race-condition or that seam does not create the components fast enough. It occurs more often on a slow
development laptop than in production environments, where the response time is way faster.
HOW TO REPLICATE:
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!
For us, this is a big problem, since all ajax parts of the application is extremely fragile and fails as soon as a double-click is made.
This in turn has stolen a lot of time for us, since we need to script our way to disabling buttons and most of the time remove tha ajax-functionality all together, just to get a 100% stable and reliant system.
At the moment there are more pressing bugs for us, like the asynchronous mailing, and quartz integrations that does not work properly, but next to that, we would be very happy if you could hunt down this bug.
It has been around for ages, I promise :)
These problems concern all versions of seam that we have tested, and they exist in trunk today (081216)
/K