在GWT中获取com.google.gwt.user.client.rpc.StatusCodeException:0 [英] Getting com.google.gwt.user.client.rpc.StatusCodeException: 0 in GWT

查看:363
本文介绍了在GWT中获取com.google.gwt.user.client.rpc.StatusCodeException:0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有时/经常在GWT中得到这个异常,但不知道为什么:

  SEVERE:com.google.gwt .user.client.rpc.StatusCodeException:0 
Unknown.java_lang_RuntimeException_RuntimeException__Ljava_lang_Throwable_2V(Unknown Source)$ b $ java.lang.RuntimeException:com.google.gwt.user.client.rpc.StatusCodeException:0

。在Unknown.de_ctech24_simplynews_web_client_util_SimpleCallback_ $ onFailure__Lde_ctech24_simplynews_web_client_util_SimpleCallback_2Ljava_lang_Throwable_2V(来源不明)
在Unknown.com_google_gwt_user_client_rpc_impl_RequestCallbackAdapter_ $ onResponseReceived__Lcom_google_gwt_user_client_rpc_impl_RequestCallbackAdapter_2Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_Response_2V(来源不明)
在Unknown.com_google_gwt_http_client_Request_ $ fireOnResponseReceived__Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_RequestCallback_2V(来源不明)
在Unknown.com_google_gwt _http_client_RequestBuilder $ 1_onReadyStateChange__Lcom_google_gwt_xhr_client_XMLHttpRequest_2V(未知来源)
。在未知<匿名>(未知来源)
。在Unknown.com_google_gwt_core_client_impl_Impl_apply__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2(未知来源)
。通过引起:com.google.gwt.user.client .rpc.StatusCodeException:0
。在Unknown.java_lang_RuntimeException_RuntimeException__Ljava_lang_String_2Ljava_lang_Throwable_2V(未知来源)
。在Unknown.com_google_gwt_user_client_rpc_StatusCodeException_StatusCodeException__ILjava_lang_String_2V(未知来源)
。在Unknown.com_google_gwt_user_client_rpc_impl_RequestCallbackAdapter_ $ onResponseReceived__Lcom_google_gwt_user_client_rpc_impl_RequestCallbackAdapter_2Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_Response_2V(未知来源)在未知
.com_google_gwt_http_client_Request_ $ fireOnResponseReceived__Lcom_google_gwt_htt p_client_Request_2Lcom_google_gwt_http_client_RequestCallback_2V(未知来源)
。在Unknown.com_google_gwt_http_client_RequestBuilder $ 1_onReadyStateChange__Lcom_google_gwt_xhr_client_XMLHttpRequest_2V(未知来源)
。在未知<匿名>(未知来源)
。在Unknown.com_google_gwt_core_client_impl_Impl_apply__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2(未知来源)

经过一段时间Google搜寻后,我发现:http://www.mail-archive.com/google-web-toolkit@googlegroups.com/msg79537.html



这里给出了一个有趣的提示:如果您<断开WLAN连接并再次连接,则发生此错误 - 然后出现错误。我在笔记本上试了这个,然后发生了异常。



另一个问题是这个例外有时会出现(并不总是在同一时间或当执行一个特定的动作 - 如看似随意虽然网络连接很好。我不知道为什么会发生这种情况,以及处理它的正确方法是什么 - 确保我能够理解并忽略它。但请求永远不会到达服务器,并且操作不会被执行 - 这不是一个很好的错误处理。



关于这个应用程序的一些数据 - 也许这有助于缩小或有希望解决问题:


  • GWT 2.4与Sencha GXT 3.0.1

  • 在所有顶级浏览器上发生在最新版本中:IE,Chrome,Firefox

  • 使用 Cloudflare 我也试过没有它 - 但它是同样的问题。所以这似乎不是来自使用此代理服务。



因为没有HTTP状态代码0,所以我们可以在每个提示和每个想法的基础上处理/解决这个问题。

解决方案

这似乎不是来自服务器 - 它可能是值得使用Firebug或其他东西进行测试,只是为了确保没有不好的反应,像这样回来。



<相反,这几乎肯定来自浏览器自我,或者连接超时或被服务器丢弃,或者浏览器无法到达服务器(坏的DNS,坏的网关,丢失的wifi,服务器不可用)。

将此视为任何意外的服务器故障 - 也许退出并再次尝试,向用户显示消息,记录错误并在连接再次运行时发送。



在所有浏览器中发生的事实都指向了网络或服务器问题 - 所有浏览器都不可能以不可预测的方式一起发生故障。这一事实也使调试更容易 - 您可以使用您最喜欢的浏览器调试工具。


I sometimes/often get this Exception in GWT but don't know why:

SEVERE: com.google.gwt.user.client.rpc.StatusCodeException: 0 
java.lang.RuntimeException: com.google.gwt.user.client.rpc.StatusCodeException: 0 
    at Unknown.java_lang_RuntimeException_RuntimeException__Ljava_lang_Throwable_2V(Unknown Source)
    at Unknown.de_ctech24_simplynews_web_client_util_SimpleCallback_$onFailure__Lde_ctech24_simplynews_web_client_util_SimpleCallback_2Ljava_lang_Throwable_2V(Unknown Source)
    at Unknown.com_google_gwt_user_client_rpc_impl_RequestCallbackAdapter_$onResponseReceived__Lcom_google_gwt_user_client_rpc_impl_RequestCallbackAdapter_2Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_Response_2V(Unknown Source)
    at Unknown.com_google_gwt_http_client_Request_$fireOnResponseReceived__Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_RequestCallback_2V(Unknown Source)
    at Unknown.com_google_gwt_http_client_RequestBuilder$1_onReadyStateChange__Lcom_google_gwt_xhr_client_XMLHttpRequest_2V(Unknown Source)
    at Unknown.<anonymous>(Unknown Source)
    at Unknown.com_google_gwt_core_client_impl_Impl_apply__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2(Unknown Source)
Caused by: com.google.gwt.user.client.rpc.StatusCodeException: 0 
    at Unknown.java_lang_RuntimeException_RuntimeException__Ljava_lang_String_2Ljava_lang_Throwable_2V(Unknown Source)
    at Unknown.com_google_gwt_user_client_rpc_StatusCodeException_StatusCodeException__ILjava_lang_String_2V(Unknown Source)
    at Unknown.com_google_gwt_user_client_rpc_impl_RequestCallbackAdapter_$onResponseReceived__Lcom_google_gwt_user_client_rpc_impl_RequestCallbackAdapter_2Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_Response_2V(Unknown Source)
    at Unknown.com_google_gwt_http_client_Request_$fireOnResponseReceived__Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_RequestCallback_2V(Unknown Source)
    at Unknown.com_google_gwt_http_client_RequestBuilder$1_onReadyStateChange__Lcom_google_gwt_xhr_client_XMLHttpRequest_2V(Unknown Source)
    at Unknown.<anonymous>(Unknown Source)
    at Unknown.com_google_gwt_core_client_impl_Impl_apply__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2(Unknown Source)

After spending some time Googling i found this: http://www.mail-archive.com/google-web-toolkit@googlegroups.com/msg79537.html

There an interesting hint was given: it occured if you disconnect your WLAN and connect again - then the error arises. I tried this on my notebook - then the exception occurs.

Another problem is this exception arises sometimes (not really always at the same time or when executing a specific action - so seemingly random) although the network connection is fine. I don't know why this happens nor what's the correct way to handle it - sure I can catch and ignore it. But the request never goes to the server and the action is not executed - not quite a good error handling.

Some data about this app - maybe this helps narrowing or hopefully solving the problem:

  • GWT 2.4 with Sencha GXT 3.0.1
  • Occurs on all the top browsers in newest version: IE, Chrome, Firefox
  • Using Cloudflare (I also tried without it - but it's the same problem. So this seems not to be originated by using this Proxy-Service.)

Thanks a lot for every hint and every idea how to handle/solve this.

解决方案

Since there is no HTTP status code 0, this appears not to be from the server - it could be worthwhile to test using Firebug or something, just to make sure that there isn't a bad response like this coming back.

Instead, this is almost certainly from the browser itself, either the connection timed out or was dropped by the server, or the browser couldn't reach the server (bad dns, bad gateway, lost wifi, server not available).

Treat this like any unexpected server failure - perhaps back off and try again, display a message to the user, log an error and send that when the connections are working again.

The fact that it is happening in all browsers points to a network or server issue - it is extremely unlikely that all browsers are failing in unpredictable ways together. This fact also makes it easier to debug - you can use your favorite browser's debug tools.

这篇关于在GWT中获取com.google.gwt.user.client.rpc.StatusCodeException:0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆