0 Replies Latest reply on Jul 24, 2007 9:19 PM by pdpantages

    seam 1.2.1, poller and NS_ERROR_NOT_AVAILABLE

    pdpantages

      Versions:
      Seam 1.2.1 GA
      Ajax - 1.1.1-SNAPSHOT (from seam dist)

      Hello ajaxers, I have an error handling question that I hope someone can help with...

      I am getting an NS_ERROR_NOT_AVAILABLE from my ajax poller. The error
      is quite legitimate, as the server is being shut down when this
      happens.

      However, when this happens, I want to be able to direct the user to an
      error page, or at least FireFox's "Unable to connect" page.

      I thought that the poller on my page would make this happen when it
      tried the next poll... But the displayed page remains unchanged. I
      see an NS_ERROR_NOT_AVAILABLE in the error console (below) and the
      poll stops (no more errors). From the point of view of the operator,
      everything looks normal.

      There is some discussion of this error in http://radio.javaranch.com/pascarello/2006/02/07/1139345471027.html

      Specifically, the fix recommended is to define your own error handler.

      So, I looked at Sec 5.5.1,
      http://labs.jboss.com/file-access/default/members/jbossajax4jsf/freezone/docs/devguide/en/html/BasicConceptsOfTheAjax4jsfFramework.html
      which describes how to define an error handler. This looks very straightforward.

      So I tried a simple alert:

      A4J.AJAX.onError = function(req,status,message) {
       // Custom Developer Code
       alert("ajax error");
      };
      
      A4J.AJAX.onExpired = function(loc,expiredMsg){
       // Custom Developer Code
       alert("ajax expired");
      };
      


      Unfortunately, my error handlers are never called. The javascript
      console does not indicte any errors in the error handlers. Just the usual NS_ERROR_NOT_AVAILABLE:

      Error: [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: http://localhost:8080/client/a4j.res/org.ajax4jsf.framework.ajax.AjaxScript.seam :: anonymous :: line 18" data: no]
      Source File: http://localhost:8080/client/a4j.res/org.ajax4jsf.framework.ajax.AjaxScript.seam
      Line: 18
      


      I must be doing something wrong here ....


      Any help would be appreciated.

      PdP