从com.google.gwt.xhr.client.XMLHttpRequest引发的NS_ERROR_NOT_INITIALIZED异常

时间:2014-11-06 14:26:04

标签: firefox gwt xmlhttprequest

我正在使用版本2.5.1中的GWT开发应用程序。

前几天我们在日志中发现有大量异常(每秒几个!!!),如下所示:

Nov 5, 2014 6:00:45 PM com.google.gwt.logging.server.RemoteLoggingServiceUtil logOnServer
SEVERE: (NS_ERROR_NOT_INITIALIZED) : 
com.google.gwt.core.client.impl.SerializableThrowable$ThrowableWithClassName: (NS_ERROR_NOT_INITIALIZED) : 
 at Unknown.ZHe(StackTraceCreator.java:174)
 at Unknown.WFe(StackTraceCreator.java:508)
 at Unknown.IHf(Exceptions.java:29)
 at Unknown.pIb(XMLHttpRequest.java:164)
 at Unknown.OMe(RequestBuilder.java:411)
 at Unknown.anonymous(XMLHttpRequest.java:351)
 at Unknown.gHe(Impl.java:189)
 at Unknown.jHe(Impl.java:243)
 at Unknown.anonymous(Impl.java:70)

至少在两种情况下,从Mozilla Firefox Web浏览器使用应用程序时出现问题。要阻止它,仅关闭浏览器是不够的,还要从任务管理器中终止进程。但我不确定它是否也不会被另一个浏览器触发。

我也在com.google.gwt.http.client.Request类中找到了这条评论,方法是cancel():

/*
 * There is a strange race condition that occurs on Mozilla when you cancel
 * a request while the response is coming in. It appears that in some cases
 * the onreadystatechange handler is still called after the handler function
 * has been deleted and during the call to XmlHttpRequest.abort(). So we
 * null the xmlHttpRequest here and that will prevent the
 * fireOnResponseReceived method from calling the callback function.
 * 
 * Setting the onreadystatechange handler to null gives us the correct
 * behavior in Mozilla but crashes IE. That is why we have chosen to fixed
 * this in Java by nulling out our reference to the XmlHttpRequest object.
 */

我不知道请求是如何工作的,但我想知道Mozilla Firefox的新版本是否会导致上述解决方案在某些情况下不起作用。

我还想补充说,问题是随机出现的,我无法按需复制。

您是否知道问题的根源是什么?如果您能解决这个问题,或者可以采取一些解决方法,请告诉我们什么?

提前谢谢!

0 个答案:

没有答案