ibm mobilefirst - How to run the "PushNotification" Sample on the MF Test Server (Remote Server)? -


i try run sample push notification, getting started (https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-6-3/notifications/push-notifications-hybrid-applications/), on mf server using , db2. sample inside mf studio eclipse works on mf development server.

problem: getting pushnotification on mobildevice

  • it works mf studio eclipse on default mf development server
  • it not work on mf test server using , db2

question: how run "pushnotification" sample on mf test server?

following environment given:

mf server (was,db2)

  mobilefirsttestserver (serverconfiguration)        |-> pushnotifications (environment)           |-> pushnotification (application) (deployed)           |-> pushadapter (adapter) (deployed)           |-> device registered 

using browser submit notification works:

request:

    http://192.168.126.133:9082/pushnotifications/invoke?adapter=pushadapter&procedure=submitnotification&parameters=[%22thomas%22,%22test%22] 

response adapter:

   /*-secure-     {"issuccessful":true,"result":"notification :: test sent user :: thomas"}*/ 

adapter code:

 wl.logger.debug("submitnotification >> userid :: " + userid + ", text :: " + notificationtext);  wl.server.notifyalldevices(usersubscription, notification); return { result: "notification :: " + notificationtext + " sent user :: " + userid }; 

it seems "wl.server.notifyalldevices" not work, why?

any idea?

logcat device

   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 loggerplugin.log blocked main thread 46ms. plugin should use cordovainterface.getthreadpool().    04-22 11:12:18.296: d/none(3146): application  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 server. defaulting local configuration    04-22 11:12:18.344: i/web console(3146): no matching configurations found server. defaulting local configuration @ 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 

was trace log .. working push .. after changing firewall settings , log level of mf test server (remote server)

  [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 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: internal error occurred during gadget request  [project pushnotifications]notification token unknown, subscribe 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 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 page: com.ibm.isclite.datastore.titleserviceexception: error retrieving title "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 page: com.ibm.isclite.datastore.titleserviceexception: error retrieving title "com.ibm.isclite.wccm.base.impl.textimpl@a895a4ef (string: null, uniquename: null)"   [4/24/15 10:22:16:666 cest] 00000161  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 not added gcm notification key. gcm service invocation failed (reason: notification_key exists)       com.ibm.pushworks.server.exceptions.gcmexception: gcm service invocation failed (reason: notification_key exists) @ com.ibm.pushworks.server.notification.gcm.gcmsender.sendtogcm(gcmsender.java:409) @ com.ibm.pushworks.server.notification.gcm.gcmsender.addtokentoandroidkey(gcmsender.java:353) @ com.ibm.pushworks.server.notification.gcm.gcmmediator.addtokentoandroidkey(gcmmediator.java:206) @ com.ibm.pushworks.server.core.pushserviceimpl.getnotificationkey(pushserviceimpl.java:1215) @ com.ibm.pushworks.server.core.pushserviceimpl.registerdevice(pushserviceimpl.java:429) @ com.worklight.integration.services.impl.dataaccessserviceimpl.updatedevicetoken(dataaccessserviceimpl.java:403) @ com.worklight.gadgets.serving.handler.notificationsubscriptionhandler.dopost(notificationsubscriptionhandler.java:126) @ com.worklight.gadgets.serving.gadgetapiservlet.dogetorpost(gadgetapiservlet.java:148) @ com.worklight.gadgets.serving.gadgetapiservlet.dopost(gadgetapiservlet.java:108) @ javax.servlet.http.httpservlet.service(httpservlet.java:595) @ javax.servlet.http.httpservlet.service(httpservlet.java:668) @ com.ibm.ws.webcontainer.servlet.servletwrapper.service(servletwrapper.java:1227) @ com.ibm.ws.webcontainer.servlet.servletwrapper.handlerequest(servletwrapper.java:776) @ com.ibm.ws.webcontainer.servlet.servletwrapper.handlerequest(servletwrapper.java:458) @ com.ibm.ws.webcontainer.servlet.servletwrapperimpl.handlerequest(servletwrapperimpl.java:178) @ com.ibm.ws.webcontainer.filter.webappfilterchain.invoketarget(webappfilterchain.java:136) @ com.ibm.ws.webcontainer.filter.webappfilterchain.dofilter(webappfilterchain.java:97) @ com.worklight.core.auth.impl.authenticationfilter$1.execute(authenticationfilter.java:215) @ com.worklight.core.auth.impl.authenticationservicebean.accessresource(authenticationservicebean.java:76) @ com.worklight.core.auth.impl.authenticationfilter.dofilter(authenticationfilter.java:220) @ com.ibm.ws.webcontainer.filter.filterinstancewrapper.dofilter(filterinstancewrapper.java:195) @ com.ibm.ws.webcontainer.filter.webappfilterchain.dofilter(webappfilterchain.java:91) @ com.ibm.ws.webcontainer.filter.webappfiltermanager.dofilter(webappfiltermanager.java:928) @ com.ibm.ws.webcontainer.filter.webappfiltermanager.invokefilters(webappfiltermanager.java:1025) @ com.ibm.ws.webcontainer.servlet.cacheservletwrapper.handlerequest(cacheservletwrapper.java:87) @ com.ibm.ws.webcontainer.webcontainer.handlerequest(webcontainer.java:909) @ com.ibm.ws.webcontainer.wswebcontainer.handlerequest(wswebcontainer.java:1662) @ com.ibm.ws.webcontainer.channel.wcchannellink.ready(wcchannellink.java:200) @ com.ibm.ws.http.channel.inbound.impl.httpinboundlink.handlediscrimination(httpinboundlink.java:459) @ com.ibm.ws.http.channel.inbound.impl.httpinboundlink.handlenewrequest(httpinboundlink.java:526) @ com.ibm.ws.http.channel.inbound.impl.httpinboundlink.processrequest(httpinboundlink.java:312) @ com.ibm.ws.http.channel.inbound.impl.httpiclreadcallback.complete(httpiclreadcallback.java:88) @ com.ibm.ws.tcp.channel.impl.aioreadcompletionlistener.futurecompleted(aioreadcompletionlistener.java:175) @ com.ibm.io.async.abstractasyncfuture.invokecallback(abstractasyncfuture.java:217) @ com.ibm.io.async.asyncchannelfuture.firecompletionactions(asyncchannelfuture.java:161) @ com.ibm.io.async.asyncfuture.completed(asyncfuture.java:138) @ com.ibm.io.async.resulthandler.complete(resulthandler.java:204) @ com.ibm.io.async.resulthandler.runeventprocessingloop(resulthandler.java:775) @ com.ibm.io.async.resulthandler$2.run(resulthandler.java:905) @ com.ibm.ws.util.threadpool$worker.run(threadpool.java:1862)    [4/24/15 10:24:35:150 cest] 00000161  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  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. 

the logcat log incomplete. not show device able receive notification token, subscribe push notifications on mfp server, etc...

  1. provide fuller logcat log
  2. verify in test server's network required addresses , ports open outgoing , incoming connections listed android, here: https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-6-3/notifications/push-notifications-hybrid-applications/#projectsetupandguidelines

Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -