我是第一次在IBM worklight(7.0)中进行推送通知配置。我已经从IBM site下载了混合应用程序的示例项目。
我坚持以下错误...请帮助我
000001ad com.ibm.pushworks.server.notification.gcm.GCMMediator W FPWSE1079W: GCM push token 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXxxxxxXXXXXXXXXXXX' is not added to GCM notification key. GCM Service invocation failed (reason: Error while invoking request)
com.ibm.pushworks.server.exceptions.GCMException: GCM Service invocation failed (reason: Error while invoking request)
at com.ibm.pushworks.server.notification.gcm.GCMSender.sendToGCM(GCMSender.java:381)
at com.ibm.pushworks.server.notification.gcm.GCMSender.addTokenToAndroidKey(GCMSender.java:353)
at com.ibm.pushworks.server.notification.gcm.GCMMediator.addTokenToAndroidKey(GCMMediator.java:206)
at com.ibm.pushworks.server.core.PushServiceImpl.getNotificationKey(PushServiceImpl.java:1848)
at com.ibm.pushworks.server.core.PushServiceImpl.updateDevice(PushServiceImpl.java:658)
at com.worklight.integration.services.impl.DataAccessServiceImpl.updateDeviceToken(DataAccessServiceImpl.java:465)
at com.worklight.gadgets.serving.handler.NotificationSubscriptionHandler.doPost(NotificationSubscriptionHandler.java:126)
at com.worklight.gadgets.serving.GadgetAPIServlet.doGetOrPost(GadgetAPIServlet.java:176)
at com.worklight.gadgets.serving.GadgetAPIServlet.doPost(GadgetAPIServlet.java:133)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
at com.worklight.gadgets.serving.GadgetAPIServlet.service(GadgetAPIServlet.java:116)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1275)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:766)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:472)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:135)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:89)
at com.worklight.core.auth.impl.AuthenticationFilter$1.execute(AuthenticationFilter.java:239)
at com.worklight.core.auth.impl.AuthenticationServiceBean.accessResource(AuthenticationServiceBean.java:76)
at com.worklight.core.auth.impl.AuthenticationFilter.doFilter(AuthenticationFilter.java:246)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:192)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:86)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:975)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1097)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:81)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:912)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.run(DynamicVirtualHost.java:262)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:938)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1156)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:626)
at java.lang.Thread.run(Thread.java:780)
Caused by: java.net.UnknownHostException: android.googleapis.com: android.googleapis.com
at java.net.InetAddress.getAllByName0(InetAddress.java:1348)
at java.net.InetAddress.getAllByName(InetAddress.java:1257)
at java.net.InetAddress.getAllByName(InetAddress.java:1182)
at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:44)
at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:102)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:319)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:363)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:219)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:86)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:106)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
at com.ibm.pushworks.server.notification.gcm.GCMSender.sendToGCM(GCMSender.java:377)
... 30 more
答案 0 :(得分:2)
我认为这里的主要问题是日志中的以下内容:
java.net.UnknownHostException:android.googleapis.com:android.googleapis.com
来自Google的文档:
如果您的组织有防火墙限制进出Internet的流量,则需要将其配置为允许与GCM连接。要打开的端口是:5228,5229和5230. GCM通常仅使用5228,但有时使用5229和5230. GCM不提供特定的IP,因此您应该允许服务器接受来自所有IP的传入连接Google的ASN 15169中列出的IP块中包含的地址。
确保所有这些都已就位,然后重试。这很可能是一个网络问题。