Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ibm mobilefirst 如何运行;“通知”;MF测试服务器(远程服务器)上的示例?_Ibm Mobilefirst_Mobilefirst Adapters_Mobilefirst Server - Fatal编程技术网

Ibm mobilefirst 如何运行;“通知”;MF测试服务器(远程服务器)上的示例?

Ibm mobilefirst 如何运行;“通知”;MF测试服务器(远程服务器)上的示例?,ibm-mobilefirst,mobilefirst-adapters,mobilefirst-server,Ibm Mobilefirst,Mobilefirst Adapters,Mobilefirst Server,我尝试使用WAS和DB2在MF服务器上运行示例推送通知(来自getting started())。MF Studio Eclipse中的示例在MF开发服务器上工作 问题:在移动设备上获取推送通知 它在默认的MF开发服务器上与MF Studio Eclipse配合使用 它在使用WAS和DB2的MF测试服务器上不起作用 问题:如何在MF测试服务器上运行“PushNotification”示例 给出了以下环境: WL.Logger.debug("submitNotification >&g

我尝试使用WAS和DB2在MF服务器上运行示例推送通知(来自getting started())。MF Studio Eclipse中的示例在MF开发服务器上工作

问题:在移动设备上获取推送通知

  • 它在默认的MF开发服务器上与MF Studio Eclipse配合使用
  • 它在使用WAS和DB2的MF测试服务器上不起作用
问题:如何在MF测试服务器上运行“PushNotification”示例

给出了以下环境:

 WL.Logger.debug("submitNotification >> userId :: " + userId + ", text :: " + notificationText);
 WL.Server.notifyAllDevices(userSubscription, notification);
return { result: "Notification :: " + notificationText + " is sent to user :: " + userId };
MF服务器(WAS、DB2)

使用浏览器提交通知有效:

 WL.Logger.debug("submitNotification >> userId :: " + userId + ", text :: " + notificationText);
 WL.Server.notifyAllDevices(userSubscription, notification);
return { result: "Notification :: " + notificationText + " is sent to user :: " + userId };
请求:

来自适配器的响应:

适配器代码:

 WL.Logger.debug("submitNotification >> userId :: " + userId + ", text :: " + notificationText);
 WL.Server.notifyAllDevices(userSubscription, notification);
return { result: "Notification :: " + notificationText + " is sent to user :: " + userId };
“WL.Server.notifyAllDevices”似乎不起作用,但为什么呢

有什么想法吗

LogCat设备

   04-22 11:12:18.280: D/WLNativeXHR(3146): callback {"headers":{"Content-Language":"en-US","Date":"Wed, 22 Apr 2015 16:22:18 GMT","Content-Length":"70","P3P":"policyref=\"/w3c/p3p.xml\", CP=\"CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE\"","Expires":"Thu, 01 Jan 1970 00:00:00 GMT","Content-Type":"application/json; charset=UTF-8","X-Powered-By":"Servlet/3.0","Pragma":"no-cache","Cache-Control":"no-cache, no-store, must-revalidate"},"status":200,"responseText":"/*-secure-\n{\"isSuccessful\":true,\"warnings\":[],\"errors\":[],\"info\":[]}*/\n","statusText":"OK"}
   04-22 11:12:18.280: W/PluginManager(3146): THREAD WARNING: exec() call to LoggerPlugin.log blocked the main thread for 46ms. Plugin should use CordovaInterface.getThreadPool().
   04-22 11:12:18.296: D/NONE(3146): Application is now  online.
   04-22 11:12:18.324: D/NONE(3146): response [/apps/services/api/PushNotifications/android/notifications] success: /*-secure-
   04-22 11:12:18.324: D/NONE(3146): {"isSuccessful":true,"warnings":[],"errors":[],"info":[]}*/
   04-22 11:12:18.344: D/CordovaLog(3146): file:///android_asset/www/default/worklight/worklight.js: Line 5755 : No matching configurations found from the server. Defaulting to local configuration
   04-22 11:12:18.344: I/Web Console(3146): No matching configurations found from the server. Defaulting to local configuration at file:///android_asset/www/default/worklight/worklight.js:5755
   04-22 11:12:18.448: D/dalvikvm(3146): GC_CONCURRENT freed 244K, 14% free 9237K/10631K, paused 37ms+8ms, total 63ms
   04-22 11:12:22.440: D/NONE(3146): Piggybacking event transmission
   04-22 11:12:22.440: D/NONE(3146): Flush called
是跟踪日志。。工作推力。。更改MF测试服务器(远程服务器)的防火墙设置和was日志级别后


LogCat日志不完整。它没有显示设备能够接收通知令牌、在MFP服务器上订阅推送通知等

  • 提供更完整的LogCat日志

  • 在测试服务器的网络中验证是否为Android列出的传出和传入连接打开了所有必需的地址和端口,如下所示:

  • 你问题中的错误在哪里?您没有在设备中收到通知吗?提到问题,添加客户端日志、服务器日志…错误是:在移动设备上,我没有收到通知。请在测试服务器的网络中验证所有所需的地址和端口是否已打开以进行传出和传入连接:在我更改了MF测试服务器(远程服务器)的一些防火墙检测和WAS日志级别后它有效。->仅用于文档:我在问题中插入了成功日志。感谢您关注我的问题。您好,Idan,我创建了一个示例视频,用于将“推送通知示例”部署到测试远程服务器。也许这在将来的某些情况下是有用的。你好,托马斯
       04-22 11:12:18.280: D/WLNativeXHR(3146): callback {"headers":{"Content-Language":"en-US","Date":"Wed, 22 Apr 2015 16:22:18 GMT","Content-Length":"70","P3P":"policyref=\"/w3c/p3p.xml\", CP=\"CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE\"","Expires":"Thu, 01 Jan 1970 00:00:00 GMT","Content-Type":"application/json; charset=UTF-8","X-Powered-By":"Servlet/3.0","Pragma":"no-cache","Cache-Control":"no-cache, no-store, must-revalidate"},"status":200,"responseText":"/*-secure-\n{\"isSuccessful\":true,\"warnings\":[],\"errors\":[],\"info\":[]}*/\n","statusText":"OK"}
       04-22 11:12:18.280: W/PluginManager(3146): THREAD WARNING: exec() call to LoggerPlugin.log blocked the main thread for 46ms. Plugin should use CordovaInterface.getThreadPool().
       04-22 11:12:18.296: D/NONE(3146): Application is now  online.
       04-22 11:12:18.324: D/NONE(3146): response [/apps/services/api/PushNotifications/android/notifications] success: /*-secure-
       04-22 11:12:18.324: D/NONE(3146): {"isSuccessful":true,"warnings":[],"errors":[],"info":[]}*/
       04-22 11:12:18.344: D/CordovaLog(3146): file:///android_asset/www/default/worklight/worklight.js: Line 5755 : No matching configurations found from the server. Defaulting to local configuration
       04-22 11:12:18.344: I/Web Console(3146): No matching configurations found from the server. Defaulting to local configuration at file:///android_asset/www/default/worklight/worklight.js:5755
       04-22 11:12:18.448: D/dalvikvm(3146): GC_CONCURRENT freed 244K, 14% free 9237K/10631K, paused 37ms+8ms, total 63ms
       04-22 11:12:22.440: D/NONE(3146): Piggybacking event transmission
       04-22 11:12:22.440: D/NONE(3146): Flush called
    
      [4/24/15 10:19:53:754 CEST] 00000160  E UOW= source=com.worklight.gadgets.serving.GadgetAPIServlet class=com.worklight.gadgets.serving.GadgetAPIServlet method=createAjaxRequestExceptionJSON org= prod= component= thread=[WebContainer : 4] requestID=[AAAGStFDCFY-AAAAAAAAALb] appName=[IBM_Worklight_project_runtime_PushNotificationsMobileFirstTestServer]
          FWLSE0020E: Ajax request exception: Notification token unknown, subscribe to PushAdapter.PushEventSource failed. [project PushNotifications]
       [4/24/15 10:19:53:767 CEST] 00000160  E UOW= source=com.worklight.gadgets.serving.GadgetAPIServlet method=createAjaxRequestExceptionJSON org=null prod=null component=null thread=[WebContainer : 4] requestID=[AAAGStFDCFY-AAAAAAAAALb] appName=[IBM_Worklight_project_runtime_PushNotificationsMobileFirstTestServer]
          FWLSE0117E: Error code: 1, error description: INTERNAL_ERROR, error message: FWLSE0069E: An internal error occurred during gadget request  [project PushNotifications]Notification token unknown, subscribe to PushAdapter.PushEventSource failed., User Identity {wl_anonymousUserRealm=null, wl_deviceNoProvisioningRealm=(name:0ef47860-0edb-3d98-b495-df2c2efd3cbc, loginModule:WLDeviceNoProvisioningLoginModule), wl_directUpdateRealm=(name:null, loginModule:WLDirectUpdateNullLoginModule), wl_deviceAutoProvisioningRealm=null, wl_antiXSRFRealm=(name:92h5o8g0b3n396s0ovnbjhhr1k, loginModule:WLAntiXSRFLoginModule), wl_authenticityRealm=null, wl_remoteDisableRealm=(name:null, loginModule:WLRemoteDisableNullLoginModule), SampleAppRealm=null, PushAppRealm=(name:Thomas, loginModule:PushAppLoginModule), SubscribeServlet=null, myserver=(name:Thomas, loginModule:PushAppLoginModule)}. [project PushNotifications]
      [4/24/15 10:20:34:639 CEST] 00000160  E UOW= source=com.worklight.integration.js.JavaScriptIntegrationLibraryImplementation class=com.worklight.integration.js.JavaScriptIntegrationLibraryImplementation method=sendMessage org= prod= component= thread=[WebContainer : 4] requestID=[AAAGStFDCFY-AAAAAAAAALr] appName=[IBM_Worklight_project_runtime_PushNotificationsMobileFirstTestServer]
          FWLSE0227E: Failed to send notification. Reason: FPWSE0009E: Internal server error. No devices found [project PushNotifications]
     [4/24/15 10:21:43:126 CEST] 00000161  E UOW= source=com.ibm.isclite.runtime.aggregation.tags.PageTitleTag class=com.ibm.isclite.runtime.aggregation.tags.PageTitleTag method= doStartTag() org= prod= component= thread=[WebContainer : 5] requestID=[AAAGStFDCFY-AAAAAAAAAMI] appName=[isclite]
          CWLAA5015W: Exception while rendering a page: com.ibm.isclite.datastore.TitleServiceException: Error retrieving title for "com.ibm.isclite.wccm.base.impl.TextImpl@ecc458d2 (string: null, uniqueName: null)" 
     [4/24/15 10:21:43:130 CEST] 00000161  W UOW= source=com.ibm.isclite.runtime.aggregation.tags.WindowTitleTag class=com.ibm.isclite.runtime.aggregation.tags.WindowTitleTag method=doStartTag() org= prod= component= thread=[WebContainer : 5] requestID=[AAAGStFDCFY-AAAAAAAAAMI] appName=[isclite]
          CWLAA5015W: Exception while rendering a page: com.ibm.isclite.datastore.TitleServiceException: Error retrieving title for "com.ibm.isclite.wccm.base.impl.TextImpl@a895a4ef (string: null, uniqueName: null)" 
     [4/24/15 10:22:16:666 CEST] 00000161  I UOW= source=com.ibm.ws.webcontainer.servlet.ServletWrapper class=com.ibm.ws.webcontainer.servlet.ServletWrapper method=init org= prod= component= thread=[WebContainer : 5] requestID=[AAAGStFDCFY-AAAAAAAAAMZ] appName=[IBM_Worklight_project_runtime_PushNotificationsMobileFirstTestServer]
          SRVE0242I: [IBM_Worklight_project_runtime_PushNotificationsMobileFirstTestServer] [/PushNotifications] [ClientLogUploaderServlet]: Initialization successful.
      [4/24/15 10:22:17:297 CEST] 00000161  W UOW= source=com.ibm.pushworks.server.notification.gcm.GCMMediator class=com.ibm.pushworks.server.notification.gcm.GCMMediator method=addTokenToAndroidKey org= prod= component= thread=[WebContainer : 5] requestID=[AAAGStFDCFY-AAAAAAAAAMb] appName=[IBM_Worklight_project_runtime_PushNotificationsMobileFirstTestServer]
          FPWSE1079W: GCM push token APA91bHtOJXjXtQvq_goqKOFvqM5ZRT8zwJEmD6U5Jyqi7hxh-EYDyv9lx0JS4LfhyPNdekJs2oYAnYpmmlqx19k9fwoE69CvZaox61u-WO6xuNE_dskvLw2lqspHoqYr9ZMwH6-gY00APw7IPXMIowDTBafzHyFVQ is not added to GCM notification key. GCM Service invocation failed (reason: notification_key already exists)
          com.ibm.pushworks.server.exceptions.GCMException: GCM Service invocation failed (reason: notification_key already exists)
    at com.ibm.pushworks.server.notification.gcm.GCMSender.sendToGCM(GCMSender.java:409)
    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:1215)
    at com.ibm.pushworks.server.core.PushServiceImpl.registerDevice(PushServiceImpl.java:429)
    at com.worklight.integration.services.impl.DataAccessServiceImpl.updateDeviceToken(DataAccessServiceImpl.java:403)
    at com.worklight.gadgets.serving.handler.NotificationSubscriptionHandler.doPost(NotificationSubscriptionHandler.java:126)
    at com.worklight.gadgets.serving.GadgetAPIServlet.doGetOrPost(GadgetAPIServlet.java:148)
    at com.worklight.gadgets.serving.GadgetAPIServlet.doPost(GadgetAPIServlet.java:108)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1227)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:776)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:458)
    at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:97)
    at com.worklight.core.auth.impl.AuthenticationFilter$1.execute(AuthenticationFilter.java:215)
    at com.worklight.core.auth.impl.AuthenticationServiceBean.accessResource(AuthenticationServiceBean.java:76)
    at com.worklight.core.auth.impl.AuthenticationFilter.doFilter(AuthenticationFilter.java:220)
    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:928)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1025)
    at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:909)
    at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:459)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:526)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:312)
    at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:88)
    at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
    at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
    at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
    at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
    at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
    at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
    at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1862)
    
      [4/24/15 10:24:35:150 CEST] 00000161  I UOW= source=com.ibm.ws.webcontainer.servlet.ServletWrapper class=com.ibm.ws.webcontainer.servlet.ServletWrapper method=init org= prod= component= thread=[WebContainer : 5] requestID=[AAAGStFDCFY-AAAAAAAAANT] appName=[isclite]
          SRVE0242I: [isclite] [/ibm/console] [/com.ibm.ws.console.probdetermination/customSelectDropLayout.jsp]: Initialization successful.
     [4/24/15 10:24:40:938 CEST] 00000161  I UOW= source=com.ibm.ws.webcontainer.servlet.ServletWrapper class=com.ibm.ws.webcontainer.servlet.ServletWrapper method=init org= prod= component= thread=[WebContainer : 5] requestID=[AAAGStFDCFY-AAAAAAAAANV] appName=[isclite]
          SRVE0242I: [isclite] [/ibm/console] [/com.ibm.ws.console.probdetermination/logfileViewLayout.jsp]: Initialization successful.