我正在 GCM (Android) 上开发一个示例应用程序。在其中,我使用 tomcat 服务器发送消息。以及接收消息的设备。一切正常,除非我的 wifi 关闭。一旦我的 wi-fi 关闭,我就停止向我的设备发送消息,并且在浏览器上我收到以下错误。任何人都可以说出wifi和GCM服务之间的联系吗?
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
java.net.UnknownHostException: android.googleapis.com
java.net.PlainSocketImpl.connect(Unknown Source)
java.net.SocksSocketImpl.connect(Unknown Source)
java.net.Socket.connect(Unknown Source)
com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source)
com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.connect(Unknown Source)
sun.net.NetworkClient.doConnect(Unknown Source)
sun.net.www.http.HttpClient.openServer(Unknown Source)
sun.net.www.http.HttpClient.openServer(Unknown Source)
sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source)
sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)
com.google.android.gcm.server.Sender.post(Sender.java:479)
com.google.android.gcm.server.Sender.post(Sender.java:458)
com.google.android.gcm.server.Sender.sendNoRetry(Sender.java:170)
com.google.android.gcm.server.Sender.send(Sender.java:121)
com.google.android.gcm.demo.server.SendAllMessagesServlet.doPost(SendAllMessagesServlet.java:82)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.33 logs.
如需更多说明,请随时询问!