Closed rvieira5 closed 1 year ago
Thanks for the report. That will be fun to debug ;)
I see the same error. This happens as IdMapper contains different values for same keys in different instance of servers. (eg: rendered component A has id j_idt38 on instance1 while it is j_idt37 on instance2, so as you post from instance1 to instance2 or vice-versa, error happens).
This can result of different order of includes depending on code or request type (html or ajax)
have no solution or work around yet :(
Please note that this bug also happens when the (Tomcat) server instances do not share their session data and the javax.faces.STATE_SAVING_METHOD
param has been set to client
.
For Mojarra 2.3 and earlier please contact your vendor for support (RedHat, IBM, Oracle, Omnifish, Payara, etceteras)
In our company, we simulate a single page app with JSF (using the AJAX functionality provided by Mojarra).
Recently, we received a requirement to enable the application to run in multiple instances. For load balancing reasons, we chose to use an approach of session sharing using Memcached, instead of the solution based on sticky sessions.
During the process of configuring the application to run on multiple instances (for instance, converting the view scoped managed beans to serializable, adding
<distributable />
tag on web.xml etc), we discovered an error which happens when the AJAX is used intensely (as we do in our application). We think this error is critical because it happens in a critical part of our application (and it can happen in other pages as well).It is important to note that the error doesn't happen every time, so it seems to have a probabilistic factor there.
I made a project with a minimal set of files I could extract from the application, which can be used to reproduce and analyse the error:
https://github.com/rvieira5/mojarra-ajax-error-clustered-environment/
We tested this in the following environments:
3 Tomcat instances (version 8.5.32) + Mojarra 2.3.9 + Memcached + nginx in Ubuntu 18.04
3 Tomcat instances (version 8.5.32) + Mojarra 2.3.9 + Memcached + nginx running inside Docker
3 Payara Micro Instances + nginx running inside Docker