0
我正在關注教程http://developer.android.com/guide/google/gcm/demo.html#server-setup。我使用網絡服務器(它是一個免費的Web服務器,不是本地主機)。一切都很好,我的設備已成功註冊到服務器,在它所說的設備已註冊的頁面上。但是,當我單擊發送消息時,下面的錯誤彈出。我不知道這是我使用的服務器阻止了一些方法(這樣我切換服務器),或谷歌提供的示例代碼有一個漏洞?韓國社交協會。android GCM示例,從服務器發送消息時出錯
對不起的異常報告是漫長的(但不知道需要什麼)
Exception report
message
description The server encountered an internal error() that prevented it from fulfilling this request.
exception
java.security.AccessControlException: access denied (java.net.SocketPermission android.googleapis.com:443 connect,resolve)
java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
java.security.AccessController.checkPermission(AccessController.java:546)
java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
java.lang.SecurityManager.checkConnect(SecurityManager.java:1034)
sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:271)
sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:328)
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:172)
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:793)
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:158)
sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:896)
sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:230)
com.google.android.gcm.server.Sender.post(Sender.java:468)
com.google.android.gcm.server.Sender.post(Sender.java:447)
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:76)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.23 logs.
是的,我做了,我的設備只在使用瀏覽器API密鑰後才被註冊。所以這不是原因 – 2012-07-14 03:31:50
您可能必須將完整堆棧跟蹤從Tomcat錯誤日誌中提取出來。 – 2012-07-14 03:33:26
你想看什麼? – 2012-07-14 03:34:34