-
1. Re: Infrequent AJAX Request Failer
youth.9009 Oct 22, 2013 8:25 AM (in response to youth.9009)1 of 1 people found this helpfulHi All,
I'm able to capture the error and display a custom message.
jsf.ajax.addOnError(showAjaxError); function showAjaxError(data){
if(data.type == "error" && data.status == "httpError" ){ // Show Error Message } }
Hope this will be helpful for some one and let me know if we have any other ways.
Thanks,
-
2. Re: Re: Infrequent AJAX Request Failer
bleathem Oct 24, 2013 9:59 PM (in response to youth.9009)RichFaces 4.1 is pretty old. have you tried RichFaces 4.3.4.Final? Also, what impl/version of JSF are you using? In what container?
-
3. Re: Re: Infrequent AJAX Request Failer
youth.9009 Dec 12, 2013 4:56 PM (in response to bleathem)We have upgraded to RichFaces 4.3.4.final recently and still we see this issue at times. Its very random and coming for any ajax request.
-
4. Re: Re: Infrequent AJAX Request Failer
bleathem Dec 12, 2013 5:06 PM (in response to youth.9009)What impl/version of JSF are you using? In what container?
Is there an associated error log on the server?
-
5. Re: Infrequent AJAX Request Failer
youth.9009 Mar 28, 2014 9:59 AM (in response to bleathem)It looks like when one requests get client error, the further requests in queue is not getting triggered. Also the new requests also not working.
We are getting the below javascript error which is cause for this issue.
SCRIPT5007: Unable to get value of the property 'getItems': object is null or undefined
packed.js, line 6569 character 19
So this is bug in Queue implementation
-
6. Re: Infrequent AJAX Request Failer
bleathem Apr 1, 2014 12:33 AM (in response to youth.9009)Can you file a jira issue with sample code and steps to reproduce?
-
7. Re: Infrequent AJAX Request Failer
youth.9009 Apr 1, 2014 8:21 PM (in response to bleathem)Hi Brian,
https://issues.jboss.org/browse/RF-12132 ( [RF-12132] Richfaces queue not cleared after js error in oncomplete attribute - JBoss Issue Tracker )
This is the issue happening for me also, but problem for me is that it happens randomly and I couldn't actually capture the scenario where the js error happening.
But from the developer console, I'm able to see the javascript error and the further requests are not processing as we have the below logic in richfaces-queue.js .
var submitFirstEntry = function() {
if (QUEUE_MODE == QUEUE_MODE_PULL && lastRequestedEntry) {
richfaces.log.debug("richfaces.queue: Waiting for previous submit results");
return;
}
Also I could see the onError handler logic, but it looks the java script errors are not being captured by this handler. So this request keep on waiting for the result which prevents further request processing.
Please let me know if we have any workaround until the issue is fixed in richfaces 5.
Thanks,
-
8. Re: Infrequent AJAX Request Failer
bleathem Apr 2, 2014 1:06 PM (in response to youth.9009)We'll have a look. However any contributions you can make in terms of providing a reliable means of reproducing will expedite the process of identifying the issue, finding any possible workarounds, and ultimately providing a fix.
-
9. Re: Infrequent AJAX Request Failer
youth.9009 Apr 2, 2014 5:05 PM (in response to bleathem)Actually we are getting the below error in packed.js.
SCRIPT5007: Unable to get value of the property 'getItems': object is null or undefined
packed.js, line 6569 character 19
So to replicate & debug easier, I have changed the compressedStage. Then figured out that the js error is happening in the below line of Autocomplete.js
var updateItemsFromCache = function (value) {
var newItems = this.cache.getItems(value, this.options.filterFunction);
this.items = $(newItems);
//TODO: works only with simple markup, not with <tr>
$(rf.getDomElement(this.id + ID.ITEMS)).empty().append(this.items);
};
In certain scenarios, this.cache becomes undefined which triggers the above js error in the console. This can be replicated if we clear the list bound to autocomplete.
i.e. if I make rateRow.makes as null & rateRow.makeCode as not null based on certain condition, further request on autocomplete throws the above js error.
<rich:autocomplete mode="lazyClient" id="makeCodes"
minChars="0" layout="table"
inputClass="autoCompleteInputMandatory" popupClass="autoCompletePopup"
selectFirst="false" autofill="false" showButton="true"
autocompleteList="#{rateRow.makes}"
value="#{rateRow.makeCode}"
var="codeObj" fetchValue="#{codeObj}"
tokens=",[]" status="commonStatus" >
<h:column>#{codeObj}</h:column>
</rich:autocomplete>
I have made this change to replicate the error, but this is not my actual scenario and I couldn't actually figure why it is happening.
Hope this will useful and still trying to identify the issue here.
-
10. Re: Infrequent AJAX Request Failer
youth.9009 Apr 13, 2014 11:57 AM (in response to youth.9009)I have made a temporary fix by passing a list with one empty value.
I have done this by changing all the autocomplete with LazyClient mode to use AutocompleteMethod instead of AutoCompleteList.
This seems to be fixed the issue. But this could be better if it is fixed in the ExtendedDataTable.js to consider the null scenario as well.
Also the request hangs in queue if any JavaScript error happens which causes the page becomes unresponsive as further requests are waiting for previous request to complete which is never going to happen.
Its would be better if we handle these kind of scenarios too as its impact is huge.
-
11. Re: Infrequent AJAX Request Failer
bleathem Apr 25, 2014 1:29 AM (in response to youth.9009)Nice debug work. Would you mind filing a jira issue with your description and workaround? Attaching any reproducers you may have would help too.